aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-03-19 20:05:30 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2022-03-19 20:05:30 +0100
commit10884179618481b67240c3a9710d8cd6c2c6b9c3 (patch)
tree9c0c2d0efea457c6f4624d8a7449cbba7397b3c7
parenta6417aab90f9b4403fb445cd17f5f83758775727 (diff)
downloadscripts-10884179618481b67240c3a9710d8cd6c2c6b9c3.tar.gz
scripts-10884179618481b67240c3a9710d8cd6c2c6b9c3.zip
Quick fixes to modify and show bluetooth volume.
-rwxr-xr-xi3blocks/i3vol.sh4
-rwxr-xr-xvol.sh2
2 files changed, 3 insertions, 3 deletions
diff --git a/i3blocks/i3vol.sh b/i3blocks/i3vol.sh
index 4a3121f..c42eafb 100755
--- a/i3blocks/i3vol.sh
+++ b/i3blocks/i3vol.sh
@@ -5,8 +5,8 @@ case $BLOCK_BUTTON in
3) pgrep -x dunst >/dev/null && notify-send -h string:x-canonical-private-synchronous:i3volHint -t 2000 "Click for alsamixer" ;;
esac
-vol=$(pactl list sinks | grep "Volume:" | sed 1q | awk '{print $5}')
-mute=$(pactl list sinks | grep "Mute:" | cut -d' ' -f2)
+vol=$(pactl list sinks | grep "Volume: f" | tail -n 1 | awk '{print $5}')
+mute=$(pactl list sinks | grep "Mute:" | cut -d' ' -f2 | tail -n 1)
if [ "$mute" = "no" ]; then
echo "🔊 $vol"
else
diff --git a/vol.sh b/vol.sh
index 22e77d3..0ee7e35 100755
--- a/vol.sh
+++ b/vol.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-sink="$(pactl list sinks | grep "^Sink " | cut -d'#' -f2)"
+sink="$(pactl list sinks | grep "^Sink " | cut -d'#' -f2 | tail -n 1)"
if [ "$1" = "mute" ]; then
pactl set-sink-mute "$sink" toggle
else