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
This commit is contained in:
nevaforget 2026-03-30 09:40:26 +02:00
parent 07264510dd
commit eb1db750c9
6 changed files with 9 additions and 36 deletions

View File

@ -64,7 +64,7 @@ then
# Execute the choice # Execute the choice
${COMMANDS[$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 else
echo "Unknown command: ${choice}" | rofi -dmenu -p "error" echo "Unknown command: ${choice}" | rofi -dmenu -p "error"
fi fi

View File

@ -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

View File

@ -38,7 +38,7 @@
origin = top-right origin = top-right
# Offset from the origin # Offset from the origin
offset = 15x15 offset = (15, 15)
# Scale factor. It is auto-detected if value is 0. # Scale factor. It is auto-detected if value is 0.
scale = 0 scale = 0
@ -202,7 +202,7 @@
enable_recursive_icon_lookup = true enable_recursive_icon_lookup = true
# Set icon theme (only used for recursive icon lookup) # 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. # You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze" # icon_theme = "Adwaita, breeze"

View File

@ -79,7 +79,7 @@ layout {
// xwayland-satellite is managed automatically since niri 25.08 // xwayland-satellite is managed automatically since niri 25.08
// kanshi is managed via systemd user service (kanshi.service) // kanshi is managed via systemd user service (kanshi.service)
spawn-at-startup "waybar" 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-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
spawn-sh-at-startup "waypaper --restore" spawn-sh-at-startup "waypaper --restore"
// spawn-sh-at-startup "nemo . &> /dev/null &" // spawn-sh-at-startup "nemo . &> /dev/null &"

View File

@ -229,10 +229,9 @@
}, },
"custom/dnd": { "custom/dnd": {
"format": "{}", "format": "{}",
"exec": "moonarch-dnd", "exec": "dunstctl is-paused | sed 's/false/󰂚/;s/true/󰂛/'",
"return-type": "json", "interval": 2,
"on-click": "dunstctl set-paused toggle", "on-click": "dunstctl set-paused toggle"
"restart-interval": 1,
}, },
"custom/notification": { "custom/notification": {
"tooltip": false, "tooltip": false,

View File

@ -58,6 +58,7 @@ window#waybar {
#cava, #cava,
#custom-gpu-usage, #custom-gpu-usage,
#custom-cpugov, #custom-cpugov,
#custom-dnd,
#custom-vpn.connected, #custom-vpn.connected,
#power-profiles-daemon, #power-profiles-daemon,
#privacy, #privacy,