Last active
September 20, 2023 11:09
-
-
Save demaniak/1ac789b1858dba78cffb075beb2d9235 to your computer and use it in GitHub Desktop.
Work-a-round for black screen after sleep on Lenovo Lengion running linux with hybrid graphics
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 | |
# After the lenovo legion laptop with Nvidia discrete graphics is woken up from sleep mode, | |
# and the screen where X is running is black, go to a text terminal (CTRL+ALT+F1). | |
# Log in, then run this script. | |
# While it is running, go back to the screen X is running on, typically CTRL+ALT+F7. | |
# After a moment or two, your X-session should come back. | |
# | |
# PS: I found ths somewhere on the web, I don't remember where. It has helped me at least. | |
# | |
# Xubuntu Jammy, LTS, Nvidia driver 525.125.06, AMD Ryzen, running in Hybrid graphics mode. | |
# | |
# I have zero idea if this is usefull to any other system configuration. | |
while true; do DISPLAY=:0 xrandr --auto && break || sleep 1s; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the script worked, remember to go back to your text terminal and log out. Probably not good to leave a logged in account running ...