summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-18 22:40:24 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-18 22:40:24 +0900
commitf7bf3a34f57400e0ba178a34e878f9b91e0fb56a (patch)
tree5692fe2ad065beb4e8866fc9de5b3a8bf205b6e0
parent97043c22d1199c4e068f9d34fbf32d946e019a76 (diff)
modified statusbar/sb-mic
-rwxr-xr-xar/.local/bin/statusbar/sb-mic28
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