zenUtils/xtraKeys.sh
2022-01-13 21:57:24 -07:00

39 lines
901 B
Bash
Executable file

#!/bin/sh
helpme(){
echo "$0 < v | b > < args >"
echo " args for v (volume) command:"
echo " u, d, m, mm (up, down, toggle mute, toggle mic mute)"
echo " args for b (brightness) command:"
echo " u, d (up, down)"
exit 1
}
if [ -z "$2" ]; then
helpme
fi
case ${1}${2} in
"vu")
amixer set Master 5%+; notify-send -u low -c volume volume $(amixer get Master | grep % | head -n 1 | awk '{print $5}')
;;
"vd")
amixer set Master 5%-; notify-send -u low -c volume volume $(amixer get Master | grep % | head -n 1 | awk '{print $5}')
;;
"vm")
amixer set Master toggle
;;
"vmm")
amixer set Capture toggle
;;
"bu")
xbacklight -inc 5; notify-send -u low -c brightness brightness [$(xbacklight -get)%]
;;
"bd")
xbacklight -dec 5; notify-send -u low -c brightness brightness [$(xbacklight -get)%]
;;
*)
helpme;;
esac
exit 0