add backlight script and binds

This commit is contained in:
ktyl 2021-08-19 01:44:32 +01:00
parent 8656401fd7
commit de246ef275
2 changed files with 30 additions and 0 deletions

View File

@ -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

22
.scripts/backlight Executable file
View File

@ -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