configuration/config/xmobar/scripts/sound
2015-03-23 23:15:26 +01:00

20 lines
397 B
Bash
Executable File

#!/bin/bash
sound="mute"
if grep -q "\[on\]" <(amixer get Master); then
current="$(amixer get Master | sed -n '/%/s/.*\[\(.*\)%\].*/\1/p' | head -1)"
if (( current <= 25 )); then
sound="none"
elif (( current <= 50 )); then
sound="low"
elif (( current <= 75 )); then
sound="medium"
else
sound="high"
fi
fi
echo "<icon=sound/$sound.xpm/>"