diff options
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-mic | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/ar/.local/bin/statusbar/sb-mic b/ar/.local/bin/statusbar/sb-mic index 00229fd..36cebca 100755 --- a/ar/.local/bin/statusbar/sb-mic +++ b/ar/.local/bin/statusbar/sb-mic @@ -1,20 +1,5 @@ #!/bin/sh -case $BLOCK_BUTTON in -1) input_source ;; -2) wpctl set-mute @DEFAULT_SOURCE@ toggle ;; -3) - notify-send "🎤 Microphone module" "\- Show current input source -- Left click to change input source -- Middle click to toggle mic" - ;; -6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -clean_line() { - echo "$1" | sed -e 's/^[[:space:]│]*//;s/[[:space:]]*$//;s/[[:space:]]*\[vol:.*\]//' -} - input_source() { # Extract Audio Sources (POSIX-compliant) audio_sources=$(wpctl status | awk ' @@ -47,6 +32,19 @@ input_source() { fi } +clean_line() { echo "$1" | sed -e 's/^[[:space:]│]*//;s/[[:space:]]*$//;s/[[:space:]]*\[vol:.*\]//'; } + +case $BLOCK_BUTTON in +1) input_source ;; +2) wpctl set-mute @DEFAULT_SOURCE@ toggle ;; +3) + notify-send "🎤 Microphone module" "\- Show current input source +- Left click to change input source +- Middle click to toggle mic" + ;; +6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + mic="$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" if [ "$mic" != "${mic%\[MUTED\]}" ]; then |
