Skip to content
Snippets Groups Projects
Commit 9ea784bf authored by Jan Hensel's avatar Jan Hensel
Browse files

scripts: update backlight script

now goes up and down, no cycling

requires xbacklight and whatnot, acpibacklight works
parent c803e784
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,8 @@ bindsym $mod+Right focus right
# split in horizontal orientation
bindsym $mod+b split h
bindsym $mod+shift+b exec scripts/backlight-cycle.sh
bindsym $mod+shift+b exec scripts/backlight-cycle.sh up
bindsym $mod+shift+v exec scripts/backlight-cycle.sh down
# split in vertical orientation
bindsym $mod+v split v
......
......@@ -5,8 +5,25 @@ set -x
current=$(xbacklight -get)
next=$(( $current + 10))
# can take args 'up' or 'down'
case $1 in
up)
next=$(( $current + 10))
;;
down)
next=$(( $current - 10))
;;
*)
echo "Usage: backlight-cycle.sh [up|down]"
exit 1
;;
esac
# clamping
if (( next > 100 )); then
next=100
fi
if (( next < 0 )); then
next=0
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment