2020-06-01 19:33:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
BACKLIGHT_FILE=~/.backlight
|
2021-01-10 18:23:35 +00:00
|
|
|
BACKLIGHT_MIN=10
|
2020-06-01 19:33:26 +00:00
|
|
|
|
|
|
|
pptk-led set red 0
|
2021-01-10 18:23:35 +00:00
|
|
|
pptk-led set green 0
|
|
|
|
pptk-led set blue 0
|
2020-06-01 19:33:26 +00:00
|
|
|
pptk-cpu-sleep disable
|
|
|
|
|
2021-10-23 10:27:05 +00:00
|
|
|
if [[ ! -e $BACKLIGHT_FILE ]]; then
|
|
|
|
echo $BACKLIGHT_MIN > $BACKLIGHT_FILE
|
|
|
|
fi
|
|
|
|
|
2020-06-01 19:33:26 +00:00
|
|
|
# restore last saved backlight level
|
|
|
|
BACKLIGHT=$((`cat $BACKLIGHT_FILE` >= $BACKLIGHT_MIN ? `cat $BACKLIGHT_FILE` : $BACKLIGHT_MIN))
|
2021-01-10 18:23:35 +00:00
|
|
|
pptk-backlight set_percent $BACKLIGHT
|
2020-06-01 19:33:26 +00:00
|
|
|
|