dotfiles_deprecated/scripts/notify_sound.sh

30 lines
781 B
Bash
Raw Normal View History

2018-03-01 00:47:14 +01:00
#!/bin/bash
volume=$(amixer sget Master | grep % | cut -f 7 -d " " | grep "[0-9]*" -o | head -1)
muted=$(amixer sget Master | grep % | cut -f 8 -d " " | head -1 | grep "off" -o)
echo $volume
if [ $muted == "off" ]
then
notify-send " " -i notification-audio-volume-muted -h int:value:0 -h string:x-canonical-private-synchronous:audio
exit
fi
if [ $volume -eq 0 ]
then
status="notification-audio-volume-muted"
elif [ $volume -lt 20 ]
then
status="notification-audio-volume-off"
elif [ $volume -lt "50" ]
then
status="notification-audio-volume-low"
elif [ $volume -lt "80" ]
then
status="notification-audio-volume-medium"
else
status="notification-audio-volume-high"
fi
notify-send " " -i $status -h int:value:$volume -h string:x-canonical-private-synchronous:audio