Last active
September 5, 2022 16:23
-
-
Save AlexMoffat/b30adc679f0b860c165608606c580de2 to your computer and use it in GitHub Desktop.
raspberry pi turn on hdmi connected display. Use fbset -s to find the current values for xres and yres. You need to make some change to the fb values before the refresh call or nothing happens.
This file contains hidden or 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 | |
set -o pipefail | |
tvservice -s | grep -q '\[TV is off\]' | |
if [[ $? -eq 0 ]]; then | |
# Turn display on. | |
/usr/bin/tvservice -p &> /dev/null | |
# Change color depth to 8 and back to 16. | |
/bin/fbset -xres 1920 -yres 1200 -depth 8 | |
/bin/fbset -xres 1920 -yres 1200 -depth 16 | |
# Now that something has changed refresh. | |
/usr/bin/xrefresh -d :0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment