diff options
author | Laura <the-ceo-of-antifa@protonmail.com> | 2023-04-25 22:07:28 +0200 |
---|---|---|
committer | Laura <the-ceo-of-antifa@protonmail.com> | 2023-04-25 22:07:28 +0200 |
commit | d59d414a9ffc7245ecda913b1f6577be14385c83 (patch) | |
tree | 83ddfd35b37008e249162387b0647ffe369555b8 /.config/waybar/getvolume.sh | |
download | dotfiles-d59d414a9ffc7245ecda913b1f6577be14385c83.tar.gz dotfiles-d59d414a9ffc7245ecda913b1f6577be14385c83.zip |
Initial commit
Diffstat (limited to '.config/waybar/getvolume.sh')
-rwxr-xr-x | .config/waybar/getvolume.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.config/waybar/getvolume.sh b/.config/waybar/getvolume.sh new file mode 100755 index 0000000..03c28fb --- /dev/null +++ b/.config/waybar/getvolume.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +sink=$(pactl list sinks |sed '/^Sink #./!d;s/^Sink #\(.\)/\1/' |tail -n1) + +if test "Mute: yes" = "$(pactl get-sink-mute $sink)" +then + echo + exit +fi + +echo $(pactl get-sink-volume $sink |sed -E '/balance/d;s/.*([0-9 ][0-9 ][0-9]%).*/\1/' |tr -d " ") |