Last active
January 13, 2018 02:19
-
-
Save andrew-carroll/9dce3e91c204beaa3355ed130fbb7c57 to your computer and use it in GitHub Desktop.
Displays and sets backlight level for intel laptops. Tested with xubuntu 16.04.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
if [ -n "$1" ]; then | |
sudo su -c "echo $1 >/sys/class/backlight/intel_backlight/brightness" | |
else | |
cat /sys/class/backlight/intel_backlight/brightness | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
original_backlight=$(backlight) | |
backlight 0 | |
touch /tmp/blackscreen | |
while [ -f /tmp/blackscreen ]; do | |
read -t 1 && rm /tmp/blackscreen | |
sudo -v | |
done | |
backlight $original_backlight |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment