From 5fb19f10389b70ee2389755106092a9ef6c64598 Mon Sep 17 00:00:00 2001 From: David Moc Date: Sun, 24 May 2026 11:48:07 +0200 Subject: Go --- polybar/scripts/dunst-status.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 polybar/scripts/dunst-status.sh (limited to 'polybar/scripts/dunst-status.sh') diff --git a/polybar/scripts/dunst-status.sh b/polybar/scripts/dunst-status.sh new file mode 100755 index 0000000..da23ddd --- /dev/null +++ b/polybar/scripts/dunst-status.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail + +if ! command -v dunstctl >/dev/null 2>&1; then + echo "n/a" + exit 0 +fi + +paused="$(dunstctl is-paused 2>/dev/null || echo unavailable)" +waiting="$(dunstctl count waiting 2>/dev/null || echo 0)" + +case "$paused" in + true) + if [ "$waiting" -gt 0 ] 2>/dev/null; then + echo "dnd $waiting" + else + echo "dnd" + fi + ;; + false) + echo "on" + ;; + *) + echo "off" + ;; +esac -- cgit v1.2.3