Ubuntu 20.10: Prevent suspend on close lid

Edit /etc/systemd/logind.conf by using your favorite editor
sudo nano /etc/systemd/logind.conf
Find line “#HandleLidSwitch=suspend”

The shortcut for searching in nano is [ctrl] + [w]

Uncomment the line

remove hashtag in front of the line

Change value from suspend to “ignore”

The following values can be used:

HandleLidSwitch=hibernate –> hiberante when lid is closed
HandleLidSwitch=ignore –> do nothing when lid is closed
HandleLidSwitch=poweroff –> shutdown when lid is closed
HandleLidSwitch=lock –> lock when lid is closed

Save file and try it

If you are using nano you can close and save the file by pressing [ctrl] + [x] then [y] and then [enter]

Leave a Reply

Your email address will not be published. Required fields are marked *