Created
May 27, 2015 15:35
-
-
Save moonhouse/bdfbb0ad68da1df2a0cc to your computer and use it in GitHub Desktop.
Next, add this to /etc/rc.local; it waits for a monitor to be attached to the HDMI socket, probes it for its preferred mode, sets that preferred mode and finally resets the framebuffer ready for X to takeover:
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
| # Wait for the TV-screen to be turned on... | |
| while ! $( tvservice --dumpedid /tmp/edid | fgrep -qv 'Nothing written!' ); do | |
| bHadToWaitForScreen=true; | |
| printf "===> Screen is not connected, off or in an unknown mode, waiting for it to become available...\n" | |
| sleep 10; | |
| done; | |
| printf "===> Screen is on, extracting preferred mode...\n" | |
| _DEPTH=32; | |
| eval $( edidparser /tmp/edid | fgrep 'preferred mode' | tail -1 | sed -Ene 's/^.+(DMT|CEA) \(([0-9]+)\) ([0-9]+)x([0-9]+)[pi]? @.+/_GROUP=\1;_MODE=\2;_XRES=\3;_YRES=\4;/p' ); | |
| printf "===> Resetting screen to preferred mode: %s-%d (%dx%dx%d)...\n" $_GROUP $_MODE $_XRES $_YRES $_DEPTH | |
| tvservice --explicit="$_GROUP $_MODE" | |
| sleep 1; | |
| printf "===> Resetting frame-buffer to %dx%dx%d...\n" $_XRES $_YRES $_DEPTH | |
| fbset --all --geometry $_XRES $_YRES $_XRES $_YRES $_DEPTH -left 0 -right 0 -upper 0 -lower 0; | |
| sleep 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment