Skip to content

Laptop doesn't suspend on lid close

Pretty much what the title says.

It's a pretty old and "used" setup i'm having right now. I considered a fresh install several times but then i always come back to the "clean and learn"-approach of fixing stuff instead of throwing it away. My host is a Lenovo Thinkpad X1 Carbon 5th Gen.

I've had i3, gnome, dwm and KDE installed as my window managers/ DEs. I'm currently running KDE as my main DE.

What i've tried so far:

  • Installed a different kernel, namely the xanmod-configuration (which get's compiled locally) and the LTS kernel. It's better there but it doesn't suspend reliably nevertheless.
  • Looked at the power-settings in the KDE system-settings, but everything seams to be set up correctly
  • Edited logind.conf for suspend to work in docked or plugged in state. It works more reliably, if the laptop is docked!

logind.conf:

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192

Right now i'm pretty much out of ideas. Does anybody know where i can look additionally? I will happily provide more information if required.

4 points9 comments
Open on Reddit
About this post
Posted
Archived
Score
4 · 100% up
Kind
Text
ID
eq0evh

Author

44
posts
81
comments
2
media
View profile

10 comments

What kind of setup exactly in regards to your swap partition and declaring the resume variable do you have?

3 points

Wow, that is a good question i haven't thought of before!

I have 16GB Ram and a swapfile (at /) with size 8GB. Will read about resume variables and come back here shortly

2 points

Ok, i have to say i haven't even set anything for the resume-variable! The LTS-Kernel is installed as a binary and for Xanmod i only set microarchitecture to 38, which is equivalent to native.

But as i interpret the Archwiki-Page, that's only relevant if i have a swap partition instead of a swapfile (?)

0 points

Ok, i have to say i haven't even set anything for the resume-variable!

Well the wiki clearly states that you have to set a kernel parameter, regardless your swap setup.

The LTS-Kernel is installed as a binary and for Xanmod i only set microarchitecture to 38, which is equivalent to native.

That is something I have zero knowledge of, to be honest.

1 points

Did you check journald for more info? Try journalctl | less or dmesg and check if there's any info. Sometimes it'll tell you which app/driver prevented sleep. There's also a possibility that the laptop is going to sleep and waking immediately.

If you are having an immediate wake from sleep, you can check (for thinkpads only):

/sys/devices/platform/thinkpad_acpi/wakeup_reason

0 will be normal behavior, 1 or 2 have to do with docks/bay ejection (IIRC).

1 points

Ironically i didn't have a suspend-issue since i posted. But i will check when it happens again.

1 points

I have a similar problem on my Laptop with Fedora installed.

When pressing the "suspend" key on my keyboard I see the expected behavior (doing "suspend" as configured in logind.conf).But when closing the Lid, the screen only flickers but stays on and nothing happens.

I configured logind.conf to HandleLidSwitch=suspend and I also get a entry in my jounal when opening/closing the lid (e.g. systemd-logind[1084]: Lid closed.). But beside that I dont see anything in the logs.

I also fiddled with various settings in logind.conf and sleep.conf and also tried to exclude problems coming from gnome-shell e.g. , but nothing helped till now.

Edit:
Seems that this was caused from a script which gnome-tweaks had in its autostart for the lid options gnome-tweaks has, and that was falsely activated.

Furthermore the LidSwitchIgnoreInhibited=yes option in logind.conf didn't change anything regarding the gnome-tweaks inhibitor.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.