From 6bb1895201f96e3e9f093c7ad43ac7d03c3a601c Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sun, 17 May 2026 21:58:50 +0200 Subject: [PATCH] sway: add DND toggle in sway and waybar --- dotfiles/desktop/.config/sway/config | 3 +++ dotfiles/desktop/.config/waybar/config.jsonc | 10 +++++++++- dotfiles/desktop/.config/waybar/style.css | 12 ++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dotfiles/desktop/.config/sway/config b/dotfiles/desktop/.config/sway/config index fbb604f..1f3c37f 100644 --- a/dotfiles/desktop/.config/sway/config +++ b/dotfiles/desktop/.config/sway/config @@ -170,6 +170,9 @@ bindsym $mod+Shift+v exec pavucontrol # File manager bindsym $mod+Shift+f exec thunar +# Do not disturb (dunst pause toggle) +bindsym $mod+Shift+d exec dunstctl set-paused toggle + # Manual lock screen bindsym $mod+Shift+x exec ~/.config/sway/scripts/lockscreen diff --git a/dotfiles/desktop/.config/waybar/config.jsonc b/dotfiles/desktop/.config/waybar/config.jsonc index 4a4c38f..b4d0f95 100644 --- a/dotfiles/desktop/.config/waybar/config.jsonc +++ b/dotfiles/desktop/.config/waybar/config.jsonc @@ -6,7 +6,7 @@ "modules-left": ["sway/workspaces"], "modules-center": [], - "modules-right": ["cpu", "memory", "disk", "temperature", "backlight", "network", "pulseaudio", "battery", "tray", "clock", "custom/power"], + "modules-right": ["cpu", "memory", "disk", "temperature", "backlight", "network", "pulseaudio", "battery", "tray", "clock", "custom/dnd", "custom/power"], "sway/workspaces": { "disable-scroll": true, @@ -99,6 +99,14 @@ "spacing": 6 }, + "custom/dnd": { + "exec": "dunstctl is-paused | grep -q true && echo '{\"text\":\"󰂛\",\"class\":\"paused\"}' || echo '{\"text\":\"󰂚\",\"class\":\"\"}'", + "return-type": "json", + "interval": 2, + "on-click": "dunstctl set-paused toggle", + "tooltip": false + }, + "custom/power": { "format": "⏻", "tooltip": false, diff --git a/dotfiles/desktop/.config/waybar/style.css b/dotfiles/desktop/.config/waybar/style.css index 81da253..63198cd 100644 --- a/dotfiles/desktop/.config/waybar/style.css +++ b/dotfiles/desktop/.config/waybar/style.css @@ -44,6 +44,7 @@ window#waybar { #pulseaudio, #battery, #tray, +#custom-dnd, #custom-power { padding: 0 8px; } @@ -67,6 +68,17 @@ window#waybar { #tray { padding: 0 6px; } +#custom-dnd { + color: #8e8e9a; + font-size: 11pt; +} +#custom-dnd.paused { + color: #e0af68; +} +#custom-dnd:hover { + background-color: rgba(224, 175, 104, 0.15); +} + #custom-power { color: #c7162b; padding: 0 10px;