13.10. Preventing the Computer from Suspending when Closing the Lid
Procedure 13.10. Configuring the lid switch
- Open the
/etc/systemd/logind.conffile for editing.
- Find the
HandleLidSwitch=suspendline in the file. If it is quoted out with the
#character at the start, unquote it.If the line is not present in the file, add it.
- Replace the default
lockfor the screen to lock;
ignorefor nothing to happen;
powerofffor the computer to switch off.
- Save your changes and close the editor.
- Run the following command so that your changes preserve the next restart of the system:
# systemctl restart systemd-logind.service
WarningKeep in mind that restarting the service forcibly interrupts any currently running GNOME session of any desktop user who is logged in. This can result in users losing unsaved data.
/etc/systemd/logind.conffile, see the