Laptop only sleeps once on lid close

The first time I close the lid it sleeps, then it doesn’t after that. This wasn’t happening with gnome.

I wrote a program to check the lid state:

from time import sleep

state = "open"

while state == "open":
    f = open("/proc/acpi/button/lid/LID0/state")
    state = f.read()
    f.close()
    state = state.split(":")[1].strip()
    sleep(0.5)

print(state)

The lid state works fine. It is definitely a KDE issue.

Thanks, that does sound like a bug. Could you move this to Bugzilla, so we can track things like affected versions, other people confirming this behavior, and most importantly, so we don’t lose track of this once the discussion thread stalls here on Discuss?

I’ll try to reproduce once the day starts and I’m on my laptop again.

@Casiofx83gt can you show a journald log after you reproduce this issue? I wonder if it doesn’t sleep or wakes up immediately again after the second lid closes event.

1 Like

I tried a minimal example and could not reproduce:

  • With my regular desktop open (Plasma 6 RC1, Wayland), close the lid. Goes to sleep.
  • Open lid. Wakes up, shows screen locker.
  • Close lid again. Goes to sleep again. I can tell by the pulsating LED pattern that ThinkPads emit once asleep.

If you want this solved, you may have to provide a bunch more data (ideally in the aforementioned bug report) so people can hopefully figure out what’s wrong with your particular setup.

It turns out it only happens when mem_sleep_default kernel parameter is set to deep

I made a bug report here: https://bugs.kde.org/show_bug.cgi?id=479572. Not sure I did it right though.

1 Like