Wednesday, May 15, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2700  / 2 Years ago, sat, august 20, 2022, 12:42:55

I want to prevent my system (Ubuntu 22.04 on old HP laptop) from sleeping when closing the lid.


I already tried to edit my /etc/systemd/logind.conf :


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

Before editing, my system slept as soon as the lid was closed; but now it takes a while before sleeping.
The odd thing is that when the lid isn't closed, the system stays awake as long as I want it to.


I don't know if any logs are going to be useful; or what the cause may be.


$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-ac-action
suspend

And


$ gsettings get org.gnome.settings-daemon.plugins.power lid-close-battery-action
suspend

More From » suspend

 Answers
1

In order to make the laptop keep on running after closing the lid run these following commands on the Terminal,


While on AC;


gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'nothing'

While on Battery;


gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing'

[#323] Sunday, August 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ttarum

Total Points: 417
Total Questions: 101
Total Answers: 115

Location: Maldives
Member since Wed, Nov 4, 2020
4 Years ago
ttarum questions
;