Created
June 5, 2020 18:31
-
-
Save giddyhup/267d76dd67ef8e1076e3e93f084fb2a7 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
export DISPLAY=:0 | |
while getopts ":ofb:" opt; do | |
case $opt in | |
o) # on | |
sudo sh -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power" | |
;; | |
f) # off | |
sudo sh -c "echo 1 > /sys/class/backlight/rpi_backlight/bl_power" | |
;; | |
b) # brightness | |
sudo sh -c "echo $2 > /sys/class/backlight/rpi_backlight/brightness" | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment