Skip to content

Instantly share code, notes, and snippets.

@zhum
Created August 19, 2018 07:10
Show Gist options
  • Save zhum/db0c6a42342c253e43e1d78ed9f30e4a to your computer and use it in GitHub Desktop.
Save zhum/db0c6a42342c253e43e1d78ed9f30e4a to your computer and use it in GitHub Desktop.
# 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