From d59d414a9ffc7245ecda913b1f6577be14385c83 Mon Sep 17 00:00:00 2001 From: Laura Date: Tue, 25 Apr 2023 22:07:28 +0200 Subject: Initial commit --- .config/waybar/getvolume.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .config/waybar/getvolume.sh (limited to '.config/waybar/getvolume.sh') 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 " ") -- cgit v1.2.3