You are not logged in.

#1 2021-12-23 07:49:40

harpium
Member
Registered: 2021-12-23
Posts: 6

Laptop not suspending on lid close

I have an Acer Swift 3 sf314-42, and I can't get it to suspend on lid close.
I have the following settings in my logind.conf file:

HandleLidSwitch=suspend
HandleLidSwitchExternalPower=suspend
HandleLidSwitchDocked=suspend

It's running GNOME, and in the tweaks app, I have "Suspend when laptop lid is closed" enabled.
tlp is installed and enabled using the default settings.
Suspend on lid close works with Manjaro and Windows, so this isn't a hardware issue. Any ideas?

Offline

#2 2021-12-23 10:26:04

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 18,648

Re: Laptop not suspending on lid close

What gets logged in the journal when you close the lid?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2021-12-23 20:01:18

harpium
Member
Registered: 2021-12-23
Posts: 6

Re: Laptop not suspending on lid close

Dec 23 11:58:30 laptop systemd-logind[410]: Lid closed.
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 31 with keysym 31 (keycode a).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 32 with keysym 32 (keycode b).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 33 with keysym 33 (keycode c).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 34 with keysym 34 (keycode d).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 35 with keysym 35 (keycode e).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 36 with keysym 36 (keycode f).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 38 with keysym 38 (keycode 11).
Dec 23 11:58:31 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 39 with keysym 39 (keycode 12).
Dec 23 11:58:38 laptop systemd-logind[410]: Lid opened.
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 35 with keysym 35 (keycode e).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 31 with keysym 31 (keycode a).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 32 with keysym 32 (keycode b).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 33 with keysym 33 (keycode c).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 34 with keysym 34 (keycode d).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 36 with keysym 36 (keycode f).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 38 with keysym 38 (keycode 11).
Dec 23 11:58:38 laptop gnome-shell[1358]: Window manager warning: Overwriting existing binding of keysym 39 with keysym 39 (keycode 12).

Last edited by harpium (2021-12-23 20:23:14)

Offline

#4 2021-12-23 21:54:19

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,419

Re: Laptop not suspending on lid close

Does removing TLP fix the problem?

What does this say

systemd-inhibit

Offline

#5 2021-12-23 21:58:53

Lilitu-Blackstar
Member
Registered: 2021-12-23
Posts: 51

Re: Laptop not suspending on lid close

check the logind.conf too

Offline

#6 2021-12-23 22:41:19

harpium
Member
Registered: 2021-12-23
Posts: 6

Re: Laptop not suspending on lid close

Head_on_a_Stick wrote:

Does removing TLP fix the problem?

What does this say

systemd-inhibit
WHO            UID  USER PID  COMM           WHAT                                                     WHY                                       MODE 
ModemManager   0    root 499  ModemManager   sleep                                                    ModemManager needs to reset devices       delay
NetworkManager 0    root 423  NetworkManager sleep                                                    NetworkManager needs to turn off networks delay
GNOME Shell    1000 eric 1315 gnome-shell    sleep                                                    GNOME needs to lock the screen            delay
discord        1000 eric 1567 Discord        sleep                                                    Application cleanup before suspend        delay
eric           1000 eric 1501 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses                 block
eric           1000 eric 1501 gsd-media-keys sleep                                                    GNOME handling keypresses                 delay
eric           1000 eric 1504 gsd-power      sleep                                                    GNOME needs to lock the screen            delay
slack          1000 eric 1520 slack          sleep                                                    Application cleanup before suspend        delay

8 inhibitors listed.

I've tried without TLP before and that doesn't fix it.

Offline

#7 2021-12-23 22:42:18

harpium
Member
Registered: 2021-12-23
Posts: 6

Re: Laptop not suspending on lid close

Lilitu-Blackstar wrote:

check the logind.conf too

Yup, I did on my first comment.

Offline

#8 2021-12-24 09:54:26

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 6,419

Re: Laptop not suspending on lid close

So does the laptop suspend at all?

Try

systemctl suspend

Or

# tee /sys/power/state <<!
mem
!

Offline

#9 2021-12-24 19:33:59

harpium
Member
Registered: 2021-12-23
Posts: 6

Re: Laptop not suspending on lid close

Yes, it does suspend when I use that command or click the power button. Actually, I just noticed that it does suspend on lid close while being charged but not when it's unplugged.

Offline

#10 2021-12-24 19:49:12

harpium
Member
Registered: 2021-12-23
Posts: 6

Re: Laptop not suspending on lid close

It looks like I didn't read the wiki carefully. There is a second file '/etc/systemd/logind.conf.d/*.conf' where I set 'HandleLidSwitch=suspend' and now it works as it should. Thanks for the help!

Offline

#11 2022-07-22 03:37:26

BenjaminNYC
Member
Registered: 2022-07-22
Posts: 1

Re: Laptop not suspending on lid close

I joined because I wanted to say that post #10 solved this issue for me. Thank you!

Last edited by BenjaminNYC (2022-07-22 03:37:58)

Offline

Board footer

Powered by FluxBB