Created
August 19, 2018 07:10
-
-
Save zhum/db0c6a42342c253e43e1d78ed9f30e4a 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
# TURN OFF HDMI if not in use | |
# Get the current video output type and strip away the unimportant bits | |
video="$(tvservice -s | sed "s/^.*\[\([^ ]*\) .*$/\1/" )" | |
if [ "$video" != "HDMI" ]; then | |
printf "HDMI not detected. Turning off.\n" | |
tvservice -off > /dev/null | |
else | |
printf "HDMI detected.\n" | |
fi | |
# TURN OFF LEDS | |
# Set the Pi Zero ACT LED trigger to 'none' | |
echo none | sudo tee /sys/class/leds/led0/trigger | |
# Turn off the Pi Zero ACT LED | |
echo 1 | sudo tee /sys/class/leds/led0/brightness |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment