KDE Black Screen After Sleep
Background/Problem
So, I have an Arch Linux [1] installation with KDE (Plasma) [2] as a desktop environment on my laptop. I used to have it configured in such a way, that the laptop would go to sleep, when I closed the lid of the laptop. Unfortunately after resuming from the sleep state, all I got was a blank black screen: no blinking input prompt, no mouse pointer, nothing. There was also no way to switch into another tty. This pretty much meant that I had to force the laptop to turn off by pressing the power button for a while and rebooting it afterwards. Not the way the sleep mode should work.
Solution
I found a workaround [3] on reddit. Thank you TJRoh01 for this.
So apparently this only happens if the current tty is tty1 (in which X runs) when you go to sleep. The solution in the mentioned workaround is to placed a script called sleep.sh into /usr/lib/systemd/system-sleep/ to switch into another tty before sleeping and back when waking back up. It has the following content and must be executable:
#!/bin/sh
if [ "${1}" == "pre" ]; then
chvt 2
elif [ "${1}" == "post" ]; then
chvt 1
fi
Take care,
Andreas
References
- J. Vinet and A. Griffin, “Arch Linux.” [Online]. Available at: https://archlinux.org/. [Accessed: 28-Aug-2020].
- KDE.org, “KED Community Home.” [Online]. Available at: https://kde.org/. [Accessed: 28-Aug-2020].
- TJRoh01, “Workaround for crash on resume! (for Thinkpads with AMD Ryzen + Arch Linux + KDE Plasma),” 19-Oct-2019. [Online]. Available at: https://www.reddit.com/r/thinkpad/comments/dk1nyt/workaround_for_crash_on_resume_for_thinkpads_with/. [Accessed: 04-Sep-2020].
Leave a comment