From eb1db750c964fed4ab3a162b5efd919cf6eac705 Mon Sep 17 00:00:00 2001 From: nevaforget Date: Mon, 30 Mar 2026 09:40:26 +0200 Subject: [PATCH] Fix dunst config loading, modernize notification handling - Point dunst to /etc/xdg/dunst/dunstrc via -conf flag (dunst with SYSCONFDIR=/etc does not search XDG_CONFIG_DIRS) - Update dunstrc: fix legacy offset syntax, replace missing Tela-purple-dark icon theme with Colloid-Grey-Catppuccin-Dark - Replace dunstify with notify-send in moonarch-cpugov for daemon-agnostic notifications, fix broken icon path - Replace dbus-monitor based moonarch-dnd script with inline waybar polling (interval 2s), fixing process accumulation bug - Add #custom-dnd to waybar CSS padding rule --- defaults/bin/moonarch-cpugov | 2 +- defaults/bin/moonarch-dnd | 27 --------------------------- defaults/xdg/dunst/dunstrc | 4 ++-- defaults/xdg/niri/config.kdl | 2 +- defaults/xdg/waybar/config | 9 ++++----- defaults/xdg/waybar/style.css | 1 + 6 files changed, 9 insertions(+), 36 deletions(-) delete mode 100755 defaults/bin/moonarch-dnd diff --git a/defaults/bin/moonarch-cpugov b/defaults/bin/moonarch-cpugov index 7d6c702..e262873 100755 --- a/defaults/bin/moonarch-cpugov +++ b/defaults/bin/moonarch-cpugov @@ -64,7 +64,7 @@ then # Execute the choice ${COMMANDS[$choice]} - dunstify --replace 553 -i "/usr/share/icons/zafiro-dark/devices/48/cpu.svg" "CPU Mode" "Set to $choice ${LABELS[$choice]}" + notify-send -h string:x-canonical-private-synchronous:cpugov -i cpu "CPU Mode" "Set to $choice ${LABELS[$choice]}" else echo "Unknown command: ${choice}" | rofi -dmenu -p "error" fi diff --git a/defaults/bin/moonarch-dnd b/defaults/bin/moonarch-dnd deleted file mode 100755 index d9daf91..0000000 --- a/defaults/bin/moonarch-dnd +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# ABOUTME: Waybar-Modul das den DND-Status von dunst als JSON ausgibt. -# ABOUTME: Wird von der Waybar custom/dnd Config referenziert. -set -euo pipefail -trap '' PIPE - -readonly ENABLED='' -readonly DISABLED='' - -dbus-monitor path='/org/freedesktop/Notifications',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged' --profile | - while read -r _; do - PAUSED="$(dunstctl is-paused)" - if [ "$PAUSED" == 'false' ]; then - CLASS="enabled" - TEXT="$ENABLED" - TOOLTIP="Notifications are on" - else - CLASS="disabled" - TEXT="$DISABLED" - TOOLTIP="Notifications are off" - COUNT="$(dunstctl count waiting)" - if [ "$COUNT" != '0' ]; then - TEXT="$DISABLED ($COUNT)" - fi - fi - printf '{"text": "%s", "class": "%s", "tooltip": "%s"}\n' "$TEXT" "$CLASS" "$TOOLTIP" - done diff --git a/defaults/xdg/dunst/dunstrc b/defaults/xdg/dunst/dunstrc index 0a83093..b3022e2 100644 --- a/defaults/xdg/dunst/dunstrc +++ b/defaults/xdg/dunst/dunstrc @@ -38,7 +38,7 @@ origin = top-right # Offset from the origin - offset = 15x15 + offset = (15, 15) # Scale factor. It is auto-detected if value is 0. scale = 0 @@ -202,7 +202,7 @@ enable_recursive_icon_lookup = true # Set icon theme (only used for recursive icon lookup) - icon_theme = "Tela-purple-dark" + icon_theme = "Colloid-Grey-Catppuccin-Dark" # You can also set multiple icon themes, with the leftmost one being used first. # icon_theme = "Adwaita, breeze" diff --git a/defaults/xdg/niri/config.kdl b/defaults/xdg/niri/config.kdl index d3e3c20..4dbd7b6 100644 --- a/defaults/xdg/niri/config.kdl +++ b/defaults/xdg/niri/config.kdl @@ -79,7 +79,7 @@ layout { // xwayland-satellite is managed automatically since niri 25.08 // kanshi is managed via systemd user service (kanshi.service) spawn-at-startup "waybar" -spawn-at-startup "dunst" +spawn-at-startup "dunst" "-conf" "/etc/xdg/dunst/dunstrc" spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" spawn-sh-at-startup "waypaper --restore" // spawn-sh-at-startup "nemo . &> /dev/null &" diff --git a/defaults/xdg/waybar/config b/defaults/xdg/waybar/config index 5a6f19c..f7101c7 100644 --- a/defaults/xdg/waybar/config +++ b/defaults/xdg/waybar/config @@ -228,11 +228,10 @@ "on-click": "alacritty paru" }, "custom/dnd": { - "format": " {} ", - "exec": "moonarch-dnd", - "return-type": "json", - "on-click": "dunstctl set-paused toggle", - "restart-interval": 1, + "format": "{}", + "exec": "dunstctl is-paused | sed 's/false/󰂚/;s/true/󰂛/'", + "interval": 2, + "on-click": "dunstctl set-paused toggle" }, "custom/notification": { "tooltip": false, diff --git a/defaults/xdg/waybar/style.css b/defaults/xdg/waybar/style.css index 196a71c..02c919a 100644 --- a/defaults/xdg/waybar/style.css +++ b/defaults/xdg/waybar/style.css @@ -58,6 +58,7 @@ window#waybar { #cava, #custom-gpu-usage, #custom-cpugov, +#custom-dnd, #custom-vpn.connected, #power-profiles-daemon, #privacy,