1
0
mirror of https://github.com/tiyn/wiki.git synced 2025-10-09 09:27:53 +02:00

linux/systemd: included guide to work with closed lid for laptops

This commit is contained in:
tiyn 2025-09-22 02:27:19 +02:00
parent b306eb9df4
commit 4451eb9b3c

View File

@ -76,7 +76,7 @@ The following line will set this to 10 minutes.
HibernateDelaySec=10min HibernateDelaySec=10min
``` ```
### Handle Power Key and Lid Seitch ### Handle Power Key and Lid Switching
The management of power keys and lid switches is handled in the file `/etc/systemd/logind.conf`. The management of power keys and lid switches is handled in the file `/etc/systemd/logind.conf`.
The following line will set the behaviour of the power key to hibernate. The default for this would The following line will set the behaviour of the power key to hibernate. The default for this would
@ -97,6 +97,24 @@ HandleLidSwitch=suspend-then-hibernate
For further behaviour of the suspend and hibernate actions check the For further behaviour of the suspend and hibernate actions check the
[corresponding section](#change-suspend-and-hibernate-behaviour). [corresponding section](#change-suspend-and-hibernate-behaviour).
When wanting to work with a closed lid some of the settings in the config file have to be set to
ignore.
As [machetie writes on Reddit](https://www.reddit.com/r/framework/comments/185035i/how_to_use_the_laptop_with_lid_closed_linux/)
the following settings need to be set.
```txt
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
```
Afterwards the logind service has to be restarted
[as described on a later section](#startstopenabledisable-a-service-and-retrieve-its-logs).
```sh
sudo systemctl restart systemd-logind
```
## Troubleshooting ## Troubleshooting
This section focusses on errors that correspond to the SystemD software. This section focusses on errors that correspond to the SystemD software.