]> Freerunner's - dotfiles.git/commitdiff
waybar/hypr: add powermenu & wallpaper buttons
authorAndre Ramnitz <tux.rising@gmail.com>
Fri, 15 Dec 2023 19:55:52 +0000 (20:55 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Sun, 18 Aug 2024 16:18:52 +0000 (18:18 +0200)
hypr/.config/hypr/scripts/powermenu.sh [new file with mode: 0755]
waybar/.config/waybar/config
waybar/.config/waybar/style.css

diff --git a/hypr/.config/hypr/scripts/powermenu.sh b/hypr/.config/hypr/scripts/powermenu.sh
new file mode 100755 (executable)
index 0000000..fe73800
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+# shamelessly stolen from https://github.com/luispabon/sway-dotfiles
+
+entries="⇠ Logout\n⏾ Suspend\n⭮ Reboot\n⏻ Shutdown"
+
+selected=$(echo -e $entries|wofi --width 250 --height 210 --dmenu --cache-file /dev/null | awk '{print tolower($2)}')
+
+case $selected in
+  logout)
+    hyprctl dispatch exit;;
+  suspend)
+    exec loginctl suspend;;
+  reboot)
+    exec loginctl reboot;;
+  shutdown)
+    exec loginctl poweroff -i;;
+esac
index 012b86dd06d7f96871ab47e6968e2294515b04cb..f99955bdd9fd3d0396c8d464c7ee28c2759079ad 100644 (file)
@@ -3,12 +3,12 @@
     "position": "bottom", // Waybar position (top|bottom|left|right)
     "height": 26, // Waybar height (to be removed for auto height)
     // "width": 1280, // Waybar width
-    "spacing": 5, // Gaps between modules (4px)
+    "spacing": 6, // Gaps between modules (4px)
     // Choose the order of the modules
     "modules-left": ["hyprland/workspaces", "mpd"],
     "modules-center": ["hyprland/window"],
        "margin": "0",
-    "modules-right": ["keyboard-state", "cpu", "memory", "temperature#temp2", "temperature", "pulseaudio", "idle_inhibitor", "clock", "tray"],
+    "modules-right": ["keyboard-state", "cpu", "memory", "temperature#temp2", "temperature", "pulseaudio", "clock", "tray", "idle_inhibitor", "custom/wallpaper", "custom/powermenu"],
 
     // Modules configuration
 
     },
 
 
-    "idle_inhibitor": {
-        "format": "{icon}",
-        "format-icons": {
-            "activated": "",
-            "deactivated": ""
-        }
-    },
-
-
     "tray": {
         // "icon-size": 21,
         "spacing": 10
     },
 
 
-    "clock": {
-        // "timezone": "America/New_York",
-        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
-        "format-alt": "{:%Y-%m-%d}"
-    },
-
-
     "cpu": {
-        "format": "{usage:2}% ",
-        "tooltip": true,
+        "format": " {usage:2}%",
                "on-click": "/usr/bin/foot -a popup htop",
                "interval": 2,
     },
 
 
     "memory": {
-        "format": "{percentage:2}% ",
+        "format": " {percentage:2}%",
+               "on-click": "/usr/bin/foot -a popup htop",
                "interval": 2,
     },
 
         "hwmon-path": "/sys/class/hwmon/hwmon4/temp7_input",
         "critical-threshold": 60,
         // "format-critical": "{temperatureC}°C {icon}",
-        "format": "WaterGPU: {temperatureC}°C {icon}",
+        "format": "{icon} {temperatureC}°C WaterGPU",
         "format-icons": ["", "", ""]
     },
 
         "hwmon-path": "/sys/class/hwmon/hwmon4/temp6_input",
         "critical-threshold": 60,
         // "format-critical": "{temperatureC}°C {icon}",
-        "format": "WaterCPU: {temperatureC}°C {icon}",
+        "format": "{icon} {temperatureC}°C WaterCPU",
         "format-icons": ["", "", ""]
     },
 
 
     "pulseaudio": {
         // "scroll-step": 1, // %, can be a float
-        "format": "{volume}% {icon} {format_source}",
-        "format-bluetooth": "{volume}% {icon} {format_source}",
+        "format": "{icon} {volume}% {format_source}",
+        "format-bluetooth": "{icon} {volume}% {format_source}",
         "format-bluetooth-muted": " {icon} {format_source}",
-        "format-muted": " {format_source}",
-        "format-source": "{volume}% ",
+        "format-muted": "  {format_source}",
+        "format-source": " {volume}%",
         "format-source-muted": "",
         "format-icons": {
             "headphone": "",
         "on-click": "pavucontrol"
     },
 
-}
 
+    "clock": {
+        // "timezone": "America/New_York",
+        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
+        "format-alt": "{:%Y-%m-%d}"
+    },
+
+
+    "idle_inhibitor": {
+        "format": "{icon}",
+        "format-icons": {
+            "activated": "",
+            "deactivated": ""
+        }
+    },
+
+
+     "custom/wallpaper": {
+        "format": "  ",
+        "on-click": "$HOME/.local/bin/rndwallpaper swww",
+       "tooltip": false,
+       "interval": "once",
+     },
+
+
+     "custom/powermenu": {
+        "format": " ⏻ ",
+        "on-click-middle": "$HOME/.config/hypr/scripts/powermenu.sh",
+       "tooltip": false,
+       "interval": "once",
+     },
+}
+# kak: filetype=json:ts=2:iw=2
index c1d9ad06461fb12a388aab3c58e7573fddd89d78..0937ec6365d95fb2f10e7d5e64ec1354652b9c0d 100644 (file)
@@ -6,35 +6,22 @@
 
 
 window#waybar {
-    background-color: rgba(43, 48, 59, 1);
+    background-color: rgba(43, 48, 59, 1.0);
     border-bottom: 2px solid rgba(100, 114, 125, 1);
     color: #ffffff;
     transition-property: background-color;
     transition-duration: .5s;
 }
-
 window#waybar.hidden {
     opacity: 0.2;
 }
-
-/*
 window#waybar.empty {
     background-color: transparent;
+    background-image: linear-gradient(0deg, rgba(0,0,0,1.0), rgba(0,0,0,0))
 }
-window#waybar.solo {
-    background-color: #FFFFFF;
+window#waybar.foot {
+    background-color: rgba(24,24,24,1.0);
 }
-*/
-
-window#waybar.termite {
-    background-color: #3F3F3F;
-}
-
-window#waybar.chromium {
-    background-color: #000000;
-    border: none;
-}
-
 
 
 #workspaces button {
@@ -46,43 +33,23 @@ window#waybar.chromium {
        border: none;
        border-radius: 0;
 }
-
 #workspaces button:hover {
        background: inherit;
        border-bottom: 2px solid tomato;
        box-shadow: inset 0 -28px #c9545d;
 }
-
 #workspaces button.active {
        font-weight: bold;
        border-bottom: 2px solid lightblue;
 }
-
 #workspaces button.focused {
        border-bottom: 2px solid #c9545d;
 }
-
 #workspaces button.urgent {
        border-bottom: 2px solid #eb4d4b;
 }
 
 
-
-button {
-    /* Use box-shadow instead of border so the text isn't offset */
-    box-shadow: inset 0 -3px transparent;
-    /* Avoid rounded borders under each button name */
-    border: none;
-    border-radius: 0;
-}
-
-/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
-button:hover {
-    background: inherit;
-    box-shadow: inset 0 -3px #ffffff;
-}
-
-
 #cpu,
 #memory,
 #temperature {