1
0
mirror of https://github.com/Dejvino/pinephone-sway-poc.git synced 2024-11-15 03:12:35 +00:00
pinephone-sway-poc/usr/local/bin/swayphone_power_wakeup

19 lines
401 B
Plaintext
Raw Normal View History

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