diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-07-09 10:28:35 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-07-09 10:28:35 +0900 |
| commit | 5f2313deb7c1187f8710724303aea078c24c7c0d (patch) | |
| tree | c95b60af4f25058ed60a73b419ed0bff136d2b11 /ar/.local/bin/statusbar | |
| parent | 2088e95117ce98190e817593d3a7c9b781110d42 (diff) | |
modified bin/rgafiles, modified statusbar/sb-mic, created statusbar/sb-micup
Diffstat (limited to 'ar/.local/bin/statusbar')
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-mic | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-micup | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/ar/.local/bin/statusbar/sb-mic b/ar/.local/bin/statusbar/sb-mic index 36cebca..faa618a 100755 --- a/ar/.local/bin/statusbar/sb-mic +++ b/ar/.local/bin/statusbar/sb-mic @@ -45,6 +45,8 @@ case $BLOCK_BUTTON in 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac +pidof -x sb-micup >/dev/null 2>&1 || sb-micup >/dev/null 2>&1 & + mic="$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" if [ "$mic" != "${mic%\[MUTED\]}" ]; then diff --git a/ar/.local/bin/statusbar/sb-micup b/ar/.local/bin/statusbar/sb-micup new file mode 100755 index 0000000..35807a0 --- /dev/null +++ b/ar/.local/bin/statusbar/sb-micup @@ -0,0 +1,12 @@ +#!/bin/sh + +# Updates the mic statusbar module when audio sources change +# (e.g. bluetooth/usb device connect/disconnect, mute changed outside dwm) + +signal() { pkill -RTMIN+5 "${STATUSBAR:-dwmblocks}" 2>/dev/null; } + +pactl subscribe 2>/dev/null | while read -r line; do + case "$line" in + *" on source #"* | *" on card #"* | *" on server"*) signal ;; + esac +done |
