system/programs/xmobar/scripts/get_volume.sh

9 lines
209 B
Bash
Raw Normal View History

#!/bin/bash
2022-07-20 15:08:50 +03:00
enabled=$(amixer -D pulse sget Master | egrep -o "\[on\]" | wc -l)
2022-04-12 23:15:05 +03:00
if [[ $enabled == "0" ]]; then
echo "off"
else
2022-07-20 15:08:50 +03:00
echo $(amixer -D pulse sget Master | egrep -o "[0-9]+%" | head -n 1)
2022-04-12 23:15:05 +03:00
fi
exit 0