From 97043c22d1199c4e068f9d34fbf32d946e019a76 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Fri, 14 Mar 2025 16:54:29 +0900 Subject: modified statusbar/sb-mic --- ar/.local/bin/statusbar/sb-mic | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'ar') 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 -- cgit v1.2.3