From 220d63254b2113f24b3a308c14acb985a0c92980 Mon Sep 17 00:00:00 2001 From: Febits <157434134+febits@users.noreply.github.com> Date: Fri, 23 Feb 2024 05:01:39 -0300 Subject: [PATCH] pulseaudio-microphone: use @DEFAULT_SOURCE@ --- .../pulseaudio-microphone/pulseaudio-microphone.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) mode change 100644 => 100755 polybar-scripts/pulseaudio-microphone/pulseaudio-microphone.sh diff --git a/polybar-scripts/pulseaudio-microphone/pulseaudio-microphone.sh b/polybar-scripts/pulseaudio-microphone/pulseaudio-microphone.sh old mode 100644 new mode 100755 index 0faf6e73..0ae0fb18 --- a/polybar-scripts/pulseaudio-microphone/pulseaudio-microphone.sh +++ b/polybar-scripts/pulseaudio-microphone/pulseaudio-microphone.sh @@ -22,23 +22,20 @@ listen() { toggle() { MUTED=$(pacmd list-sources | awk '/\*/,EOF {print}' | awk '/muted/ {print $2; exit}') - DEFAULT_SOURCE=$(pacmd list-sources | awk '/\*/,EOF {print $3; exit}') if [ "$MUTED" = "yes" ]; then - pactl set-source-mute "$DEFAULT_SOURCE" 0 + pactl set-source-mute @DEFAULT_SOURCE@ 0 else - pactl set-source-mute "$DEFAULT_SOURCE" 1 + pactl set-source-mute @DEFAULT_SOURCE@ 1 fi } increase() { - DEFAULT_SOURCE=$(pacmd list-sources | awk '/\*/,EOF {print $3; exit}') - pactl set-source-volume "$DEFAULT_SOURCE" +5% + pactl set-source-volume @DEFAULT_SOURCE@ +5% } decrease() { - DEFAULT_SOURCE=$(pacmd list-sources | awk '/\*/,EOF {print $3; exit}') - pactl set-source-volume "$DEFAULT_SOURCE" -5% + pactl set-source-volume @DEFAULT_SOURCE@ -5% } case "$1" in