2015-03-08 22:16:03 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-03-23 23:15:26 +01:00
|
|
|
sound="mute"
|
|
|
|
|
2015-03-08 22:16:03 +01:00
|
|
|
if grep -q "\[on\]" <(amixer get Master); then
|
|
|
|
current="$(amixer get Master | sed -n '/%/s/.*\[\(.*\)%\].*/\1/p' | head -1)"
|
|
|
|
if (( current <= 25 )); then
|
2015-03-23 23:15:26 +01:00
|
|
|
sound="none"
|
2015-03-08 22:16:03 +01:00
|
|
|
elif (( current <= 50 )); then
|
2015-03-23 23:15:26 +01:00
|
|
|
sound="low"
|
2015-03-08 22:16:03 +01:00
|
|
|
elif (( current <= 75 )); then
|
2015-03-23 23:15:26 +01:00
|
|
|
sound="medium"
|
2015-03-08 22:16:03 +01:00
|
|
|
else
|
2015-03-23 23:15:26 +01:00
|
|
|
sound="high"
|
2015-03-08 22:16:03 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-06-11 09:16:55 +02:00
|
|
|
echo '<action=`pavucontrol`><icon=sound/'"$sound.xpm"'/></action>'
|
2015-03-23 23:15:26 +01:00
|
|
|
|