From 8c579317cae180aa9d29fe8b37efa1d8ceb39c7c Mon Sep 17 00:00:00 2001 From: Viyurz <128215328+Viyurz@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:51:00 +0100 Subject: [PATCH] Waybar: Added "Do not disturb" toggle --- .config/hypr/hyprland.conf | 2 ++ .config/waybar/config | 16 +++++++++++++++- .config/waybar/style.css | 6 ++++-- .scripts/set-wallpaper.sh | 3 --- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 289b446..43640e9 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -22,6 +22,8 @@ exec-once = nm-applet exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = $HOME/.scripts/swayidle.sh exec-once = swayosd-server +exec-once = mako + # XWayland exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 diff --git a/.config/waybar/config b/.config/waybar/config index 38b1747..172e3f9 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -20,7 +20,8 @@ "memory", "custom/cpu-temp", "cpu", - "clock" + "clock", + "custom/dnd-toggle" ], "hyprland/workspaces": { @@ -197,5 +198,18 @@ "today": "{}" } } + }, + "custom/dnd-toggle": { + "exec": "$HOME/.scripts/waybar-dnd-toggle.sh --no-toggle", + "interval": "once", + "on-click": "$HOME/.scripts/waybar-dnd-toggle.sh; pkill -SIGRTMIN+2 waybar", + "signal": 2, + "tooltip": false, + "return-type": "json", + "format": "{icon} {}", + "format-icons": { + "dnd-enabled": "󰂛", + "dnd-disabled": "󰂚" + } } } diff --git a/.config/waybar/style.css b/.config/waybar/style.css index bdb1994..b8c6b0a 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -78,7 +78,8 @@ #custom-gpu-temp, #custom-gpu-usage, #custom-cpu-temp, -#cpu { +#cpu, +#custom-dnd-toggle.dnd-disabled { color: @accent1; } @@ -92,7 +93,8 @@ } #pulseaudio.output.muted, -#pulseaudio.input.source-muted { +#pulseaudio.input.source-muted, +#custom-dnd-toggle.dnd-enabled { color: @disabled; } diff --git a/.scripts/set-wallpaper.sh b/.scripts/set-wallpaper.sh index 17e8680..8fa84bb 100755 --- a/.scripts/set-wallpaper.sh +++ b/.scripts/set-wallpaper.sh @@ -325,9 +325,6 @@ else if pgrep -u "$USER" mako > /dev/null; then echo "Reloading Mako." makoctl reload & - else - echo "Starting Mako." - hyprctl dispatch exec mako > /dev/null & fi fi