43 lines
1,002 B
Bash
Executable file
43 lines
1,002 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# wrapper for common keybinds across environments
|
|
# by Derek Stevens <nilix@nilfm.cc>
|
|
# MIT License
|
|
|
|
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
|