Also update volume module on monitor (dis)connect and on exiting pulsemixer

This commit is contained in:
appeasementPolitik 2023-04-24 11:03:49 +00:00 committed by GitHub
parent 7ce43eef1e
commit 09e0cd58a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
# Prints the current volume or 🔇 if muted. # Prints the current volume or 🔇 if muted.
case $BLOCK_BUTTON in case $BLOCK_BUTTON in
1) setsid -f "$TERMINAL" -e pulsemixer ;; 1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;; 2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;; 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;; 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;

View File

@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
# Update the volume module in the statusbar whenever # Update the volume module in the statusbar whenever
# headphones are added or removed. # headphones and monitors are added or removed.
while :; do while :; do
grep -qP -m1 '^jack\/headphone' <(acpi_listen) || exit 1 grep -q -m1 '^jack/headphone\|^jack/lineout' <(acpi_listen) || exit 1
pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}"
done done