aboutsummaryrefslogtreecommitdiff
path: root/scripts/.local/bin/personal/bar/mute
diff options
context:
space:
mode:
authordavidpkj <davidpenkow1@gmail.com>2023-08-27 16:36:12 +0200
committerdavidpkj <davidpenkow1@gmail.com>2023-08-27 16:36:12 +0200
commit8ec89f25e98c83bd348856f767ae2d193583d91a (patch)
treeef3fc77835de77bde0b74d8e6146932843ac8fa5 /scripts/.local/bin/personal/bar/mute
parentd6c6ff9997cc7d8b48a77dd8880d2cab3481d462 (diff)
Reorganize scripts
Diffstat (limited to 'scripts/.local/bin/personal/bar/mute')
-rwxr-xr-xscripts/.local/bin/personal/bar/mute8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/.local/bin/personal/bar/mute b/scripts/.local/bin/personal/bar/mute
index 834618a..7c987a2 100755
--- a/scripts/.local/bin/personal/bar/mute
+++ b/scripts/.local/bin/personal/bar/mute
@@ -2,9 +2,10 @@
SOURCE="alsa_input.usb-R__DE_Microphones_R__DE_NT-USB_Mini_610BAACA-00.mono-fallback"
-if [[ "$1" == "shortstatus" ]]; then
- VOLUME="$(pactl get-source-volume "$SOURCE" | grep -o [0-9]*%)"
+SOURCE="$(pactl get-default-source)"
+VOLUME="$(pactl get-source-volume "$SOURCE" | grep -o [0-9]*% | head -n 1)"
+if [[ "$1" == "shortstatus" ]]; then
if [[ "$VOLUME" == "0%" ]]; then
echo "Muted"
else
@@ -16,14 +17,13 @@ fi
if [[ "$1" == "status" ]]; then
NAME="$(pactl list sources | grep -o Description:.* | sed -n 's/Description: //g;2p')"
- VOLUME="$(pactl get-source-volume "$SOURCE" | grep -o [0-9]*%)"
echo "$NAME ($VOLUME)"
exit
fi
-if [[ "$(pactl get-source-volume $SOURCE | grep -o [0-9]*%)" == "0%" ]]; then
+if [[ "$VOLUME" == "0%" ]]; then
pactl set-source-volume "$SOURCE" 70%
notify-send -u low "Unmuted" -r 110
else