add backlight script and binds
This commit is contained in:
parent
8656401fd7
commit
de246ef275
|
@ -138,6 +138,14 @@ super + {Left,Down,Up,Right}
|
|||
super + shift + g
|
||||
$SCRIPTS/toggle-gaps
|
||||
|
||||
#
|
||||
# screen brightness
|
||||
#
|
||||
XF86MonBrightnessUp
|
||||
$SCRIPTS/backlight +
|
||||
|
||||
XF86MonBrightnessDown
|
||||
$SCRIPTS/backlight -
|
||||
|
||||
#
|
||||
# media keys
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
step=2
|
||||
value=`xbacklight -get`
|
||||
|
||||
# double, halve value or bail
|
||||
if [ "$1" == "+" ]; then
|
||||
let value*=$step
|
||||
elif [ "$1" == "-" ]; then
|
||||
let value/=$step
|
||||
else
|
||||
echo "usage: backlight +, backlight -"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# check range
|
||||
min=1
|
||||
max=100
|
||||
[[ $value -lt $min ]] && value=$min
|
||||
[[ $value -gt $max ]] && value=$max
|
||||
|
||||
xbacklight -set $value -steps 10
|
Loading…
Reference in New Issue