1

I have installed TLP due to short battery life but I can't get the lid to work. When I close it and I open it again the screen is off (doesn't even turn on), but everything else is working (like the keyboard backlight). I've tried everything I could find on the Internet but nothing seems to work... here's what I did: Set LID0 to enabled in /proc/acpi/wakeup and uncomment the line in /etc/systemd/logind.conf that says HandleLidSwitch=suspend.

I've an MSI GF63 10SC-055IT running Arch Linux (DE GNOME 41.3 Wayland) with kernel version 5.16.

R1D3R175
  • 11
  • 1
  • 4
  • I had a similar problem a while back and my workaround was to assign a keyboard shortcut to the `xrandr` command that set up my screen and then I would press the shortcut when this happened and that would cause the screen to work ([Screen corruption after hibernate — Is there another way to refresh the X11 display?](https://unix.stackexchange.com/a/185598)). Does that help? – terdon Feb 22 '22 at 10:42
  • @terdon Unfortunately, when I execute the command to quickly turn off and on, I get the following error `X Error of failed request: BadMatch (invalid parameter attributes)`. I literally took the command and replaced it with my display name (which is XWAYLAND0). Also tried executing as sudo but didn't work. – R1D3R175 Feb 22 '22 at 11:22
  • Oh yeah, `xrandr` doesn't work with wayland. Please [edit] your question and add that you're using Wayland. Have you tried using X instead? See https://wiki.archlinux.org/title/GNOME#Xorg_sessions – terdon Feb 22 '22 at 11:43
  • @terdon Unfortunately switching to X11 isn't worth it, the color calibration of my second monitor is messed up and everything is much slower. – R1D3R175 Feb 22 '22 at 16:05

2 Answers2

1

I've been working with debian gnu/linux and old lenovo laptops for a few years and i had the same problem.

When the laptop went to sleep or I closed the lid, the screen stayed black.

My solution was to uncomment and set:

HandleLidSwitch=ignore

HandleLidSwitchExternalPower=ignore

HandleLidSwitchDocked=ignore

in /etc/systemd/logind.conf

Do a reboot after you change it

Z0OM
  • 1
  • 4
  • 24
  • 56
  • Didn't work. Now the laptop won't suspend on it's own when I close the lid and if I suspend manually and reopen the problem still persist. – R1D3R175 Feb 24 '22 at 07:24
  • Ok it's looks that xrandr works only with X11 at the moment. There is a "read-only" XRandR support in Xwayland, but it cannot send request back to the Wayland compositor so X11 applications have no control over the output configurations. Try wlr-randr or gnome-randr or search for xrandr wayland equivalent. – Z0OM Feb 24 '22 at 08:00
  • Did you try the DRI_PRIME=1 %command% ? – Z0OM Feb 24 '22 at 08:07
  • No, I didn't. I don't even know what that is ^^" – R1D3R175 Feb 24 '22 at 16:31
  • Btw, I've noticed that when I "lock" and not "suspend" the screen goes back on after closing and re-opening the lid. – R1D3R175 Feb 24 '22 at 16:34
  • For me it looks like an old bug with the lid (sleep|suspend|hibernate|lock) :-) try to search for "wayland equivalent" wayland is the future for a stable linux desktop ^^ maybe they will fix the lid bug in the future, if you find a solution pls post it ^^ – Z0OM Feb 24 '22 at 17:04
  • I'll dig more into it, if I'll (eventually) find a solution I'll indeed post a solution to help other people with the same issue :) – R1D3R175 Feb 25 '22 at 21:54
0

I'd like to comment here if you found some solution but I don't have the reputation...

I have the same problem with lenovo laptop. When I close the lid and laptop goes to sleep, after wake up, there is only black screen and I have to shut it down with long press of power button. When I put it to sleep by clicking by mouse on suspend power button in menu, then laptop wakes up correctly. It's annoying. I am using ubuntu 2004 with wayland.

Dalton
  • 111
  • 2