40 lines
901 B
Bash
40 lines
901 B
Bash
|
#!/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
|