mirror of
https://git.korhonen.cc/FunctionalHacker/dotfiles.git
synced 2024-11-08 13:10:37 +00:00
Switched to lqsd so this is not needed anymore
Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
This commit is contained in:
parent
0803f4cedd
commit
fef66ded1f
@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
save="/tmp/bkl"
|
||||
|
||||
idle_backlight=0
|
||||
fade_step_time=0.02
|
||||
|
||||
get_brightness() {
|
||||
float=$(light -G $1)
|
||||
printf '%.*f\n' 0 $float
|
||||
}
|
||||
|
||||
save(){
|
||||
get_brightness > "$save"
|
||||
}
|
||||
|
||||
resume(){
|
||||
val=$(cat "$save")
|
||||
set_backlight "$val"
|
||||
}
|
||||
|
||||
set_backlight(){
|
||||
local level
|
||||
for level in $(eval echo {$(get_brightness)..$1}); do
|
||||
light -S $level
|
||||
sleep $fade_step_time
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
while getopts "drs0" opt; do
|
||||
case $opt in
|
||||
d)
|
||||
set_backlight "$idle_backlight"
|
||||
;;
|
||||
r)
|
||||
resume
|
||||
;;
|
||||
s)
|
||||
save
|
||||
;;
|
||||
0)
|
||||
set_backlight 0
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
Loading…
Reference in New Issue
Block a user