From 5039f8bad13545bce55c7c3c0b402e2fd143bcfc Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 12 Sep 2026 18:55:23 +0200 Subject: [PATCH] feat(waybar): add mako do-not-disturb toggle --- home/dotfiles/waybar/config.jsonc | 26 ++++++++++++++++++++++++++ home/dotfiles/waybar/style.css | 5 +++++ 2 files changed, 31 insertions(+) diff --git a/home/dotfiles/waybar/config.jsonc b/home/dotfiles/waybar/config.jsonc index dd060afdcb2266a83c579a62af6baa9684e12f05..0a0f9ae7ebaecace1f5f85e9c48d3d5fefeb4208 100644 --- a/home/dotfiles/waybar/config.jsonc +++ b/home/dotfiles/waybar/config.jsonc @@ -16,6 +16,7 @@ "modules-center": [ ], "modules-right": [ + "custom/dnd", "idle_inhibitor", "pulseaudio", "network", @@ -51,6 +52,18 @@ "tooltip": true, "tooltip-format": "{app}: {title}" }, + "custom/dnd": { + "exec": "if makoctl mode | grep -qx do-not-disturb; then echo '{\"alt\":\"on\",\"class\":\"on\",\"tooltip\":\"Do not disturb: on\"}'; else echo '{\"alt\":\"off\",\"class\":\"off\",\"tooltip\":\"Do not disturb: off\"}'; fi", + "return-type": "json", + "format": "{icon}", + "format-icons": { + "on": "", + "off": "" + }, + "on-click": "makoctl mode -t do-not-disturb; pkill -RTMIN+8 waybar", + "signal": 8, + "interval": 60 + }, "idle_inhibitor": { "format": "{icon}", "format-icons": { @@ -155,6 +168,7 @@ "modules-center": [ ], "modules-right": [ + "custom/dnd", "idle_inhibitor", "pulseaudio", "network", @@ -191,6 +205,18 @@ "tooltip": true, "tooltip-format": "{app}: {title}" }, + "custom/dnd": { + "exec": "if makoctl mode | grep -qx do-not-disturb; then echo '{\"alt\":\"on\",\"class\":\"on\",\"tooltip\":\"Do not disturb: on\"}'; else echo '{\"alt\":\"off\",\"class\":\"off\",\"tooltip\":\"Do not disturb: off\"}'; fi", + "return-type": "json", + "format": "{icon}", + "format-icons": { + "on": "", + "off": "" + }, + "on-click": "makoctl mode -t do-not-disturb; pkill -RTMIN+8 waybar", + "signal": 8, + "interval": 60 + }, "idle_inhibitor": { "format": "{icon}", "format-icons": { diff --git a/home/dotfiles/waybar/style.css b/home/dotfiles/waybar/style.css index 33d110a169fe42729c17d5646fe46319cb55b063..37b5f12847a7fc0bec4af2a8a2aa184bfa67deaa 100644 --- a/home/dotfiles/waybar/style.css +++ b/home/dotfiles/waybar/style.css @@ -84,6 +84,7 @@ button:hover { #custom-media, #tray, #mode, +#custom-dnd, #idle_inhibitor, #scratchpad, #power-profiles-daemon, @@ -135,6 +136,10 @@ button:hover { padding-right: 15px; } +#custom-dnd.on { + color: #f53c3c; +} + label:focus { background-color: #000000; }