23 lines
736 B
Bash
Executable File
23 lines
736 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# control for the mute key, toggles mute/unmute
|
|
|
|
if [ $1 = '-m' ]; then
|
|
mutecontrol=$(amixer get Master | grep 'Front Left:' | awk '{ print $6 }')
|
|
if [ $mutecontrol = "[on]" ]; then
|
|
amixer set Master mute
|
|
notify-send "Sound muted."
|
|
elif [ $mutecontrol = "[off]" ]; then
|
|
amixer set Master unmute
|
|
notify-send "Sound unmuted."
|
|
fi
|
|
elif [ $1 = "-d" ]; then
|
|
amixer set Master 10%-
|
|
volume=$(amixer get Master |grep 'Front Left:' |awk '{ print $5 }' |sed -e 's/\[//' |sed -e 's/\]//')
|
|
notify-send "Sound lowered to $volume"
|
|
elif [ $1 = "-u" ]; then
|
|
amixer set Master 10%+
|
|
volume=$(amixer get Master |grep 'Front Left:' |awk '{ print $5 }' |sed -e 's/\[//' |sed -e 's/\]//')
|
|
notify-send "Sound raised to $volume"
|
|
fi
|