summaryrefslogtreecommitdiff
path: root/ar
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-14 16:54:29 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-03-14 16:54:29 +0900
commit97043c22d1199c4e068f9d34fbf32d946e019a76 (patch)
tree5abed261d4f3dace2cfe4f784324b164547b8592 /ar
parentf643735fcce89aa029dde2bfc1472fc013f376ac (diff)
modified statusbar/sb-mic
Diffstat (limited to 'ar')
-rwxr-xr-xar/.local/bin/statusbar/sb-mic30
1 files changed, 16 insertions, 14 deletions
diff --git a/ar/.local/bin/statusbar/sb-mic b/ar/.local/bin/statusbar/sb-mic
index 7c5aebc..00229fd 100755
--- a/ar/.local/bin/statusbar/sb-mic
+++ b/ar/.local/bin/statusbar/sb-mic
@@ -1,10 +1,21 @@
#!/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:.*\]//'
}
-change() {
+input_source() {
# Extract Audio Sources (POSIX-compliant)
audio_sources=$(wpctl status | awk '
/^Audio$/ {audio=1}
@@ -32,23 +43,14 @@ change() {
# Set the new default input source
if [ -n "$chosen_id" ]; then
wpctl set-default "$chosen_id"
- notify-send "Input Source Changed" "Now using: $chosen_source"
+ notify-send "🎀Input Source Changed" "Now using: $chosen_source"
fi
}
-if wpctl get-volume @DEFAULT_AUDIO_SOURCE@ 2>/dev/null | grep -q "MUTED"; then
+mic="$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
+
+if [ "$mic" != "${mic%\[MUTED\]}" ]; then
echo "😷"
else
echo "😲"
fi
-
-case $BLOCK_BUTTON in
-1) change ;;
-2) wpctl set-mute @DEFAULT_AUDIO_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