Join me on Facebook!
— Written by Triangles on August 27, 2015 • updated on January 14, 2019 • ID 14 —
Whenever I close the laptop lid, it goes to sleep mode. How can I disable such behavior?
I have a crappy HP netbook with Ubuntu Server 14.04 on it. Whenever I close the lid, hibernation mode kicks in. I definitely don't like that: during hibernation the machine stops working. The solution: tweak a parameter on a systemd configuration file. Systemd is a set of core tools that form a basic building block for Linux. In particular I am going to touch systemd-logind, a daemon responsible for login management.
In order to disable hibernation when the lid is closed, follow these steps:
HandleLidSwitch=suspendand set it to
HandleLidSwitch=ignore. Add it if it does not exist or uncomment it if its commented out (i.e. if there a hash at the beginning of the line);
That's it. To bring the original configuration back, switch that line to
HandleLidSwitch=suspend, or simply comment the line.