2020-03-08 21:43:12 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
if [ "$1" == "inc" ]; then
|
|
|
|
amixer -q sset Master 5%+
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" == "dec" ]; then
|
|
|
|
amixer -q sset Master 5%-
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" == "mute" ]; then
|
|
|
|
amixer -q sset Master toggle
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
AMIXER=$(amixer sget Master)
|
2020-03-09 11:22:42 +00:00
|
|
|
VOLUME=$(echo "$AMIXER" | grep 'Mono\|Front Right:' | awk -F'[][]' '{ print $2 }' | tr -d "%")
|
2020-03-08 21:43:12 +00:00
|
|
|
MUTE=$(echo "$AMIXER" | grep -o '\[off\]' | tail -n 1)
|
|
|
|
if [ "$MUTE" == "[off]" ]; then
|
|
|
|
ICON=audio-volume-muted
|
|
|
|
elif [ "$VOLUME" -le 20 ]; then
|
|
|
|
ICON=audio-volume-low
|
|
|
|
elif [ "$VOLUME" -le 60 ]; then
|
|
|
|
ICON=audio-volume-medium
|
|
|
|
else
|
|
|
|
ICON=audio-volume-high
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
notify-send.py "Volume" "$VOLUME/100" \
|
|
|
|
--hint string:image-path:$ICON boolean:transient:true \
|
|
|
|
--replaces-process "volume-popup"
|