Waybar: Added "Do not disturb" toggle

This commit is contained in:
Viyurz 2023-11-13 11:51:00 +01:00
parent 695e6676a8
commit 8c579317ca
No known key found for this signature in database
4 changed files with 21 additions and 6 deletions

View file

@ -22,6 +22,8 @@ exec-once = nm-applet
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = $HOME/.scripts/swayidle.sh exec-once = $HOME/.scripts/swayidle.sh
exec-once = swayosd-server exec-once = swayosd-server
exec-once = mako
# XWayland # XWayland
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2

View file

@ -20,7 +20,8 @@
"memory", "memory",
"custom/cpu-temp", "custom/cpu-temp",
"cpu", "cpu",
"clock" "clock",
"custom/dnd-toggle"
], ],
"hyprland/workspaces": { "hyprland/workspaces": {
@ -197,5 +198,18 @@
"today": "<span color='#ff6699'><b>{}</b></span>" "today": "<span color='#ff6699'><b>{}</b></span>"
} }
} }
},
"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": "󰂚"
}
} }
} }

View file

@ -78,7 +78,8 @@
#custom-gpu-temp, #custom-gpu-temp,
#custom-gpu-usage, #custom-gpu-usage,
#custom-cpu-temp, #custom-cpu-temp,
#cpu { #cpu,
#custom-dnd-toggle.dnd-disabled {
color: @accent1; color: @accent1;
} }
@ -92,7 +93,8 @@
} }
#pulseaudio.output.muted, #pulseaudio.output.muted,
#pulseaudio.input.source-muted { #pulseaudio.input.source-muted,
#custom-dnd-toggle.dnd-enabled {
color: @disabled; color: @disabled;
} }

View file

@ -325,9 +325,6 @@ else
if pgrep -u "$USER" mako > /dev/null; then if pgrep -u "$USER" mako > /dev/null; then
echo "Reloading Mako." echo "Reloading Mako."
makoctl reload & makoctl reload &
else
echo "Starting Mako."
hyprctl dispatch exec mako > /dev/null &
fi fi
fi fi