Last active
October 11, 2015 10:09
-
-
Save matoken/16f6841cdbf79e51b718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MUTE=`amixer -c 0 get Master|tail -1|cut -d '[' -f 4|sed s/\]//` | |
if [ $MUTE = "on" ] ; then | |
ICON="/usr/share/icons/ContrastHigh/scalable/status/audio-volume-medium.svg" | |
else | |
ICON="/usr/share/icons/ContrastHigh/scalable/status/audio-volume-muted.svg" | |
fi | |
case "$1" in | |
"XF86AudioMute" ) | |
if [ $MUTE = "on" ] ; then | |
amixer -q -c 0 set Master mute | |
xset -b | |
echo -e "🔊☓\nmute!" | |
notify-send -u low -t 500 -i '/usr/share/icons/ContrastHigh/scalable/status/audio-volume-muted.svg' mute "☓" | |
else | |
amixer -q -c 0 set Master unmute | |
amixer -q -c 0 set Speaker unmute | |
amixer -q -c 0 set Headphone unmute | |
xset b | |
echo -e "🔊\nunmute!" | |
amixer -c 0 get Master | tail -1 | cut -d '[' -f 2 | sed s/\]// | xargs notify-send -u low -t 500 -i '/usr/share/icons/ContrastHigh/scalable/status/audio-volume-high.svg' numute | |
fi | |
;; | |
"XF86AudioRaiseVolume" ) | |
amixer -c 0 set Master 2dB+ | tail -1 | cut -d '[' -f 2 | sed s/\]// | xargs notify-send -u low -t 500 -i $ICON "Vol ⤴" | |
;; | |
"XF86AudioLowerVolume" ) | |
amixer -c 0 set Master 2dB- | tail -1 | cut -d '[' -f 2 | sed s/\]// | xargs notify-send -u low -t 500 -i $ICON "Vol ⤵" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
~/.config/awesome/rc.lua