nixos/config/xmobar/scripts/volume.sh

9 lines
243 B
Bash
Raw Normal View History

2023-07-24 22:18:55 +04:00
#!/bin/sh
# Get the maximum volume of any pulseaudio sink channel
# amixer get Master | egrep -o "[0-9]+%"
vol=$(amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "MM" } else { print $2 }}' | head -n 1)
echo Vol: $vol%
exit 0