To disable automatic suspend when closing the laptop lid in Linux, you’ll need to modify the /etc/systemd/logind.conf file. Specifically, you’ll change the HandleLidSwitch setting from suspend to either ignore (for no action) or lock (to lock the screen). 

Here’s how to do it: 

  1. Open the file: Use a text editor with sudo privileges (e.g., sudo nano /etc/systemd/logind.conf).
  2. Locate the line: Find the line HandleLidSwitch=suspend (it might be commented out with a #).
  3. Modify the setting:
    • To disable suspend: Remove the # (comment) and change HandleLidSwitch=suspend to HandleLidSwitch=ignore.
    • To lock the screen: Remove the # and change HandleLidSwitch=suspend to HandleLidSwitch=lock.
  4. Save the changes: Save the file (Ctrl+X, Y, Enter in nano).
  5. Restart the service: Run sudo systemctl restart systemd-logind.service to apply the changes.
After this, closing the lid should no longer trigger automatic suspend and either lock the screen or do nothing, depending on your choice.

By faiz

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *