moonarch/defaults/bin/moonarch-dnd
nevaforget c3213cc0ce Rofi/Waybar aufräumen: tote Scripts entfernen, Themes konsolidieren
- GTK-Style-Script und Template-System entfernt (Catppuccin fest)
- 15 tote/inkompatible Scripts gelöscht (Hyprland, X11, Duplikate)
- Rasi-Themes von Einzelordnern in themes/ konsolidiert
- Waybar: Timezone fix, BAT0, JSON-Struktur, Icons restored
- Waybar: GTK-Menu durch wlogout on-click ersetzt
- Alle Script-Pfade auf /etc/xdg/rofi/themes/ aktualisiert
- moonarch-session als Rofi-basierte Übergangslösung hinzugefügt
- moonarch-dnd: broken pipe bei Waybar-Restart behoben
- Style.css vom System übernommen
2026-03-27 13:19:48 +01:00

28 lines
853 B
Bash
Executable File

#!/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