diff options
Diffstat (limited to 'polybar')
| -rwxr-xr-x | polybar/.config/polybar/scripts/mic-status.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/polybar/.config/polybar/scripts/mic-status.sh b/polybar/.config/polybar/scripts/mic-status.sh index aae580c..b068c27 100755 --- a/polybar/.config/polybar/scripts/mic-status.sh +++ b/polybar/.config/polybar/scripts/mic-status.sh @@ -1,5 +1,10 @@ #!/bin/bash +# Loops until pactl can successfully connect and find the default source +while ! pactl get-source-mute @DEFAULT_SOURCE@ &>/dev/null; do + sleep 0.5 +done + # Function to check the default source's mute status get_mic_status() { # We look for the default source and check its 'Mute' field @@ -7,7 +12,7 @@ get_mic_status() { # Convert the volume to percentage mic_percentage=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F'/' '/Volume:/ {print $2}' | xargs) - + if [ "$STATUS" = "yes" ]; then #echo " Muted" # Use your preferred icon/text echo " $mic_percentage" |
