Ubuntu: How can I tell Ubuntu to do nothing when I close my laptop lid?
Question: I would like closing the laptop lid to be a no-op. How can I do that?
Solutions Sample (Please watch the whole video to see all solutions, in order of how many people found them helpful):
== This solution helped 272 people ==
**** For 13.10 - 18.04: ****
To make Ubuntu do nothing when laptop lid is closed:
1. Open the /etc/systemd/logind.conf file in a text editor as root, for
example,
sudo -H gedit /etc/systemd/logind.conf
2. Add a line HandleLidSwitch=ignore (make sure it's not commented out!),
3. Restart the systemd daemon with this command:
sudo restart systemd-logind
or, from 15.04 onwards:
sudo service systemd-logind restart
----
See also: https://askubuntu.com/questions/36061...
to-sleep-when-closing-laptop-lid
For Gnome Users:
If you are using Gnome, then you can do this easily without changing system
settings using the Gnome Tweak Tool. It can be installed from the Ubuntu
Software Store (It is called GNOME Tweaks).
Under Power, Turn off the setting to do nothing when lid is closed. I tested
this on Ubuntu 18.04 and it works.
== This solution helped 2 people ==
Let us create a script that works on all versions
#!/bin/bash
PLEASE FEEL FREE TO CHANGE THE SCRIPT
Ubuntu 16.04 [PLEASE COMPLETE]
sed -i '/HandleLidSwitch/d' /etc/systemd/logind.conf >/dev/null 1&>2
echo 'HandleLidSwitch=nothing' >> /etc/systemd/logind.conf >/dev/null 1&>2
Ubuntu 14.04 [PLEASE COMPLETE]
sed -i '/IgnoreLid/d' /etc/UPower/UPower.conf >/dev/null 1&>2
echo 'IgnoreLid=true'>> /etc/UPower/UPower.conf
[PLEASE COMPLETE ]
gconftool-2 -t string -s /apps/gnome-power-manager/buttons/lid_ac [PLEASE
COMPLETE ]
gconftool-2 -t string -s /apps/gnome-power-manager/buttons/lid_battery
nothing [PLEASE COMPLETE ]
RESTART SERVICES
service upower restart
service systemd-logind restart
== This solution helped 2 people ==
You can easily disable the lid lock feature by clicking the System Settings
icon in the Launcher/Task bar, and then clicking on Brightness & Lock.
From there, you flip the Lock switch to the off position, and un-check the
"Require my password when wakening from suspend." check-box.
[enter_image_description_here]
Another thing you have to watch for if you also plan on setting up hibernation
(suspend-to-disk) is whether or not your system has a large enough swap
partition to actually go into hibernation. Hibernation is different than
suspend, but sometimes people like to set up the hibernation feature while they
are configuring suspend.
You can also go over your Power settings, so they don't suspend the system when
the lid is close. You can do this in System Setting -> Power.
[enter_image_description_here]
== This solution helped 2 people ==
***** 11.04 and previous versions *****
you can also go to system->preferences->power management
near bottom of the window you will find a dropdown where you can select what
your system does when lid is closed
== This solution helped 2 people ==
***** 12.04 *****
In System Settings, open Brightness & Lock. On that page, uncheck the checkbox
at the bottom that says, "Require my password when waking from suspend."
With thanks & praise to God! With thanks to all the many who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music & music license: https://www.bensound.com/royalty-free... | Images & images license: https://stocksnap.io/license and others | With thanks to user Zargles (https://askubuntu.com/users/869874), user user123456 (https://askubuntu.com/users/411261), user Tasos Koutoumanos (https://askubuntu.com/users/207689), user SunnyDaze (https://askubuntu.com/users/654972), user Sid (https://askubuntu.com/users/4776), user Sandeep Poonia (https://askubuntu.com/users/286711), user Robie Basak (https://askubuntu.com/users/7808), user Ramon Suarez (https://askubuntu.com/users/42485), user Pavlos G. (https://askubuntu.com/users/6650), user Patrick (https://askubuntu.com/users/225962), user mrfromage (https://askubuntu.com/users/501703), user Matt M. (https://askubuntu.com/users/830845), user Mateo (https://askubuntu.com/users/47291), user Kelley (https://askubuntu.com/users/19610), user Jorge Castro (https://askubuntu.com/users/235), user Jorge Castro (https://askubuntu.com/users/235), user Fynn (https://askubuntu.com/users/556555), user fossfreedom (https://askubuntu.com/users/14356), user binW (https://askubuntu.com/users/6713), user badp (https://askubuntu.com/users/1938), and the Stack Exchange Network (http://stackoverflow.com/questions/15.... Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything should be amiss at Roel D.OT VandePaar A.T gmail.com.