From 09e0cd58a8b1bcb990d89940fb9a67122c12cf2b Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Mon, 24 Apr 2023 11:03:49 +0000 Subject: [PATCH] Also update volume module on monitor (dis)connect and on exiting pulsemixer --- .local/bin/statusbar/sb-volume | 2 +- .local/bin/volumed | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index acdf7a9e..fa0abcd5 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -3,7 +3,7 @@ # Prints the current volume or 🔇 if muted. 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 ;; 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;; 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;; diff --git a/.local/bin/volumed b/.local/bin/volumed index cb48e80c..2f1927d4 100644 --- a/.local/bin/volumed +++ b/.local/bin/volumed @@ -1,9 +1,9 @@ #!/bin/bash # Update the volume module in the statusbar whenever -# headphones are added or removed. +# headphones and monitors are added or removed. 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}" done