nixos/config/xmobar/scripts/volume.sh
2023-07-24 21:18:55 +03:00

8 lines
243 B
Bash

#!/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