Ubuntu 17.10 and later: Don't suspend when lid is closed, just lock screen
up vote
26
down vote
favorite
Since my upgrade to Ubuntu 17.10 there's no option in the settings about what to do when the notebook-lid is closed any more.
Before this function had the options "do nothing" and "suspend" and maybe "shutdown".
The "do nothing" function did something: when the lid was closed, the display went dark and the screen was locked with the password.
My question is how to change the setting so that it's like I'm used to, so that the screen just locks but doesn't suspend when closing the lid.
suspend power-management lid gnome-power-manager standby
add a comment |
up vote
26
down vote
favorite
Since my upgrade to Ubuntu 17.10 there's no option in the settings about what to do when the notebook-lid is closed any more.
Before this function had the options "do nothing" and "suspend" and maybe "shutdown".
The "do nothing" function did something: when the lid was closed, the display went dark and the screen was locked with the password.
My question is how to change the setting so that it's like I'm used to, so that the screen just locks but doesn't suspend when closing the lid.
suspend power-management lid gnome-power-manager standby
1
I have posted a Gnome bug report, please also support adding this to settings, I have bad experiences with them and having lots of people asking for it might help. Here it is: bugzilla.gnome.org/show_bug.cgi?id=790043
– conualfy
Nov 8 '17 at 4:46
To JohnDabc: it seems that you did not follow Legolas's instructions. In order your system to lock when you close the lid, you MUST undo the tweak (that is to Launch Tweaks, go to the "Power" section and ENABLE suspend on lid-close). To cboettig: yes, it is possible using the same method (changing the logind.conf file). You must add the lines below in /etc/systemd/logind.conf [Login] HandleLidSwitch=lock HandleLidSwitchDocked=ignore
– Chris.p
Dec 11 '17 at 16:01
@Chris.p I have Unity Tweak Tool 0.0.7 . I don't see a "Power" section. I have four major areas [Unity, Window Manager, Appearance, System]. None of them has a section called "Power".
– Scooter
Jan 28 at 1:19
add a comment |
up vote
26
down vote
favorite
up vote
26
down vote
favorite
Since my upgrade to Ubuntu 17.10 there's no option in the settings about what to do when the notebook-lid is closed any more.
Before this function had the options "do nothing" and "suspend" and maybe "shutdown".
The "do nothing" function did something: when the lid was closed, the display went dark and the screen was locked with the password.
My question is how to change the setting so that it's like I'm used to, so that the screen just locks but doesn't suspend when closing the lid.
suspend power-management lid gnome-power-manager standby
Since my upgrade to Ubuntu 17.10 there's no option in the settings about what to do when the notebook-lid is closed any more.
Before this function had the options "do nothing" and "suspend" and maybe "shutdown".
The "do nothing" function did something: when the lid was closed, the display went dark and the screen was locked with the password.
My question is how to change the setting so that it's like I'm used to, so that the screen just locks but doesn't suspend when closing the lid.
suspend power-management lid gnome-power-manager standby
suspend power-management lid gnome-power-manager standby
edited Oct 25 at 8:03
pomsky
27.6k1184111
27.6k1184111
asked Nov 2 '17 at 15:31
JohnDabc
146126
146126
1
I have posted a Gnome bug report, please also support adding this to settings, I have bad experiences with them and having lots of people asking for it might help. Here it is: bugzilla.gnome.org/show_bug.cgi?id=790043
– conualfy
Nov 8 '17 at 4:46
To JohnDabc: it seems that you did not follow Legolas's instructions. In order your system to lock when you close the lid, you MUST undo the tweak (that is to Launch Tweaks, go to the "Power" section and ENABLE suspend on lid-close). To cboettig: yes, it is possible using the same method (changing the logind.conf file). You must add the lines below in /etc/systemd/logind.conf [Login] HandleLidSwitch=lock HandleLidSwitchDocked=ignore
– Chris.p
Dec 11 '17 at 16:01
@Chris.p I have Unity Tweak Tool 0.0.7 . I don't see a "Power" section. I have four major areas [Unity, Window Manager, Appearance, System]. None of them has a section called "Power".
– Scooter
Jan 28 at 1:19
add a comment |
1
I have posted a Gnome bug report, please also support adding this to settings, I have bad experiences with them and having lots of people asking for it might help. Here it is: bugzilla.gnome.org/show_bug.cgi?id=790043
– conualfy
Nov 8 '17 at 4:46
To JohnDabc: it seems that you did not follow Legolas's instructions. In order your system to lock when you close the lid, you MUST undo the tweak (that is to Launch Tweaks, go to the "Power" section and ENABLE suspend on lid-close). To cboettig: yes, it is possible using the same method (changing the logind.conf file). You must add the lines below in /etc/systemd/logind.conf [Login] HandleLidSwitch=lock HandleLidSwitchDocked=ignore
– Chris.p
Dec 11 '17 at 16:01
@Chris.p I have Unity Tweak Tool 0.0.7 . I don't see a "Power" section. I have four major areas [Unity, Window Manager, Appearance, System]. None of them has a section called "Power".
– Scooter
Jan 28 at 1:19
1
1
I have posted a Gnome bug report, please also support adding this to settings, I have bad experiences with them and having lots of people asking for it might help. Here it is: bugzilla.gnome.org/show_bug.cgi?id=790043
– conualfy
Nov 8 '17 at 4:46
I have posted a Gnome bug report, please also support adding this to settings, I have bad experiences with them and having lots of people asking for it might help. Here it is: bugzilla.gnome.org/show_bug.cgi?id=790043
– conualfy
Nov 8 '17 at 4:46
To JohnDabc: it seems that you did not follow Legolas's instructions. In order your system to lock when you close the lid, you MUST undo the tweak (that is to Launch Tweaks, go to the "Power" section and ENABLE suspend on lid-close). To cboettig: yes, it is possible using the same method (changing the logind.conf file). You must add the lines below in /etc/systemd/logind.conf [Login] HandleLidSwitch=lock HandleLidSwitchDocked=ignore
– Chris.p
Dec 11 '17 at 16:01
To JohnDabc: it seems that you did not follow Legolas's instructions. In order your system to lock when you close the lid, you MUST undo the tweak (that is to Launch Tweaks, go to the "Power" section and ENABLE suspend on lid-close). To cboettig: yes, it is possible using the same method (changing the logind.conf file). You must add the lines below in /etc/systemd/logind.conf [Login] HandleLidSwitch=lock HandleLidSwitchDocked=ignore
– Chris.p
Dec 11 '17 at 16:01
@Chris.p I have Unity Tweak Tool 0.0.7 . I don't see a "Power" section. I have four major areas [Unity, Window Manager, Appearance, System]. None of them has a section called "Power".
– Scooter
Jan 28 at 1:19
@Chris.p I have Unity Tweak Tool 0.0.7 . I don't see a "Power" section. I have four major areas [Unity, Window Manager, Appearance, System]. None of them has a section called "Power".
– Scooter
Jan 28 at 1:19
add a comment |
4 Answers
4
active
oldest
votes
up vote
32
down vote
To disable suspend on lid-close
Install Tweaks (
gnome-tweak-tool
) by running
sudo apt-get install gnome-tweak-tool
Launch Tweaks, go to the "Power" section and disable suspend on lid-close.
To enable lock on lid-close
Undo the above steps before following this. Also, SAVE ALL YOUR WORK, the second command would require you to reboot.
Add the lines below in
/etc/systemd/logind.conf
[Login]
HandleLidSwitch=lock
Run
sudo systemctl restart systemd-logind
Sources
- freedesktop.org - logind.conf
- How to Change Lid Close Action in Ubuntu 18.04 LTS - Tips on Ubuntu
1
thanks, at least closing the lid dont suspends the notebook anymore. but now it really does "nothing" but turning the screen of. after reopening the screen is not locked and i dont need my password. (like usual before 17.10). maybe someone knows how to change this via terminal?
– JohnDabc
Nov 2 '17 at 15:53
I appended few additional steps. Can you check and confirm?
– Legolas
Nov 2 '17 at 17:48
No. first editing wasn't so easy, since everythings different with 17.10, solution: "sudo gedit admin:///etc/systemd/logind.conf" (via askubuntu.com/a/968196/755218 ) now the last line of the saved file is "HandleLidSwitch=lock". hand to do a hard poweroff after running the command, but when i now close the lid nothing changes.
– JohnDabc
Nov 3 '17 at 13:00
I have added the exact content of my file in the answer. I have checked it, this works, and yes you would have to do a hard reboot.
– Legolas
Nov 3 '17 at 14:27
2
No don't works with me, this is how the file looks after editing and still after reboot: i.stack.imgur.com/o9d9P.png
– JohnDabc
Nov 3 '17 at 15:11
|
show 5 more comments
up vote
1
down vote
You could install dconf-editor
to change what happens when lid is closed.
sudo apt-get install dconf-editor
go to org.gnome.settings-daemon.plugins.power
in dconf-editor
. you can change the value of lid-close-ac-action
and lid-close-battery-action
for changing the action when lid closed.The possible values are 'suspend','hibernate','logout','shutdown','nothing'.
Via CLI would be:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action suspend
add a comment |
up vote
1
down vote
In Ubuntu 18.04 Gnome desktop, there is no option in the Settings utility for configuring the laptop lid close actions. And Gnome Tweaks only offers a switch to enable / disable the "Suspend when laptop lid is closed" option.
For those who want it to shut down automatically, hibernate, or do nothing when the laptop lid is closed, here’s how to do it by hacking the configuration file:
Open a terminal by pressing Ctrl+Alt+T or searching for “Terminal” from start menu. When it opens, run the following command:
sudo gedit /etc/systemd/logind.conf
When the files opens, uncomment the line
#HandleLidSwitch=suspend
by removing#
in the beginning, and change the value to :
HandleLidSwitch=poweroff
: shutdown / power off when lid is closed.
HandleLidSwitch=hibernate
: hibernate when lid is closed (need to test
if hibernate works).
HandleLidSwitch=ignore
: do nothing.
HandleLidSwitch=suspend
: suspend laptop when lid is closed.
Save the file and finally restart the Systemd service to apply changes via command:
systemctl restart systemd-logind.service
Source
New contributor
1
LuFFy: An edit and an upvote. Use 8 spaces instead of 4 when you're indenting or using numbered or bulleted lists. have a look at my edits to see how I did it... ;-)
– Fabby
Nov 30 at 10:25
1
Thanks @Fabby, I will keep in mind that.
– LuFFy
Nov 30 at 11:27
add a comment |
up vote
0
down vote
Install gnome-tweaks
sudo apt-get install gnome-tweaks
and invoke it with
gnome-tweaks
Under the menu Power you can disable Suspend when laptop lid is closed.
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
32
down vote
To disable suspend on lid-close
Install Tweaks (
gnome-tweak-tool
) by running
sudo apt-get install gnome-tweak-tool
Launch Tweaks, go to the "Power" section and disable suspend on lid-close.
To enable lock on lid-close
Undo the above steps before following this. Also, SAVE ALL YOUR WORK, the second command would require you to reboot.
Add the lines below in
/etc/systemd/logind.conf
[Login]
HandleLidSwitch=lock
Run
sudo systemctl restart systemd-logind
Sources
- freedesktop.org - logind.conf
- How to Change Lid Close Action in Ubuntu 18.04 LTS - Tips on Ubuntu
1
thanks, at least closing the lid dont suspends the notebook anymore. but now it really does "nothing" but turning the screen of. after reopening the screen is not locked and i dont need my password. (like usual before 17.10). maybe someone knows how to change this via terminal?
– JohnDabc
Nov 2 '17 at 15:53
I appended few additional steps. Can you check and confirm?
– Legolas
Nov 2 '17 at 17:48
No. first editing wasn't so easy, since everythings different with 17.10, solution: "sudo gedit admin:///etc/systemd/logind.conf" (via askubuntu.com/a/968196/755218 ) now the last line of the saved file is "HandleLidSwitch=lock". hand to do a hard poweroff after running the command, but when i now close the lid nothing changes.
– JohnDabc
Nov 3 '17 at 13:00
I have added the exact content of my file in the answer. I have checked it, this works, and yes you would have to do a hard reboot.
– Legolas
Nov 3 '17 at 14:27
2
No don't works with me, this is how the file looks after editing and still after reboot: i.stack.imgur.com/o9d9P.png
– JohnDabc
Nov 3 '17 at 15:11
|
show 5 more comments
up vote
32
down vote
To disable suspend on lid-close
Install Tweaks (
gnome-tweak-tool
) by running
sudo apt-get install gnome-tweak-tool
Launch Tweaks, go to the "Power" section and disable suspend on lid-close.
To enable lock on lid-close
Undo the above steps before following this. Also, SAVE ALL YOUR WORK, the second command would require you to reboot.
Add the lines below in
/etc/systemd/logind.conf
[Login]
HandleLidSwitch=lock
Run
sudo systemctl restart systemd-logind
Sources
- freedesktop.org - logind.conf
- How to Change Lid Close Action in Ubuntu 18.04 LTS - Tips on Ubuntu
1
thanks, at least closing the lid dont suspends the notebook anymore. but now it really does "nothing" but turning the screen of. after reopening the screen is not locked and i dont need my password. (like usual before 17.10). maybe someone knows how to change this via terminal?
– JohnDabc
Nov 2 '17 at 15:53
I appended few additional steps. Can you check and confirm?
– Legolas
Nov 2 '17 at 17:48
No. first editing wasn't so easy, since everythings different with 17.10, solution: "sudo gedit admin:///etc/systemd/logind.conf" (via askubuntu.com/a/968196/755218 ) now the last line of the saved file is "HandleLidSwitch=lock". hand to do a hard poweroff after running the command, but when i now close the lid nothing changes.
– JohnDabc
Nov 3 '17 at 13:00
I have added the exact content of my file in the answer. I have checked it, this works, and yes you would have to do a hard reboot.
– Legolas
Nov 3 '17 at 14:27
2
No don't works with me, this is how the file looks after editing and still after reboot: i.stack.imgur.com/o9d9P.png
– JohnDabc
Nov 3 '17 at 15:11
|
show 5 more comments
up vote
32
down vote
up vote
32
down vote
To disable suspend on lid-close
Install Tweaks (
gnome-tweak-tool
) by running
sudo apt-get install gnome-tweak-tool
Launch Tweaks, go to the "Power" section and disable suspend on lid-close.
To enable lock on lid-close
Undo the above steps before following this. Also, SAVE ALL YOUR WORK, the second command would require you to reboot.
Add the lines below in
/etc/systemd/logind.conf
[Login]
HandleLidSwitch=lock
Run
sudo systemctl restart systemd-logind
Sources
- freedesktop.org - logind.conf
- How to Change Lid Close Action in Ubuntu 18.04 LTS - Tips on Ubuntu
To disable suspend on lid-close
Install Tweaks (
gnome-tweak-tool
) by running
sudo apt-get install gnome-tweak-tool
Launch Tweaks, go to the "Power" section and disable suspend on lid-close.
To enable lock on lid-close
Undo the above steps before following this. Also, SAVE ALL YOUR WORK, the second command would require you to reboot.
Add the lines below in
/etc/systemd/logind.conf
[Login]
HandleLidSwitch=lock
Run
sudo systemctl restart systemd-logind
Sources
- freedesktop.org - logind.conf
- How to Change Lid Close Action in Ubuntu 18.04 LTS - Tips on Ubuntu
edited Oct 17 at 20:23
Pablo Bianchi
2,2131528
2,2131528
answered Nov 2 '17 at 15:48
Legolas
1,12359
1,12359
1
thanks, at least closing the lid dont suspends the notebook anymore. but now it really does "nothing" but turning the screen of. after reopening the screen is not locked and i dont need my password. (like usual before 17.10). maybe someone knows how to change this via terminal?
– JohnDabc
Nov 2 '17 at 15:53
I appended few additional steps. Can you check and confirm?
– Legolas
Nov 2 '17 at 17:48
No. first editing wasn't so easy, since everythings different with 17.10, solution: "sudo gedit admin:///etc/systemd/logind.conf" (via askubuntu.com/a/968196/755218 ) now the last line of the saved file is "HandleLidSwitch=lock". hand to do a hard poweroff after running the command, but when i now close the lid nothing changes.
– JohnDabc
Nov 3 '17 at 13:00
I have added the exact content of my file in the answer. I have checked it, this works, and yes you would have to do a hard reboot.
– Legolas
Nov 3 '17 at 14:27
2
No don't works with me, this is how the file looks after editing and still after reboot: i.stack.imgur.com/o9d9P.png
– JohnDabc
Nov 3 '17 at 15:11
|
show 5 more comments
1
thanks, at least closing the lid dont suspends the notebook anymore. but now it really does "nothing" but turning the screen of. after reopening the screen is not locked and i dont need my password. (like usual before 17.10). maybe someone knows how to change this via terminal?
– JohnDabc
Nov 2 '17 at 15:53
I appended few additional steps. Can you check and confirm?
– Legolas
Nov 2 '17 at 17:48
No. first editing wasn't so easy, since everythings different with 17.10, solution: "sudo gedit admin:///etc/systemd/logind.conf" (via askubuntu.com/a/968196/755218 ) now the last line of the saved file is "HandleLidSwitch=lock". hand to do a hard poweroff after running the command, but when i now close the lid nothing changes.
– JohnDabc
Nov 3 '17 at 13:00
I have added the exact content of my file in the answer. I have checked it, this works, and yes you would have to do a hard reboot.
– Legolas
Nov 3 '17 at 14:27
2
No don't works with me, this is how the file looks after editing and still after reboot: i.stack.imgur.com/o9d9P.png
– JohnDabc
Nov 3 '17 at 15:11
1
1
thanks, at least closing the lid dont suspends the notebook anymore. but now it really does "nothing" but turning the screen of. after reopening the screen is not locked and i dont need my password. (like usual before 17.10). maybe someone knows how to change this via terminal?
– JohnDabc
Nov 2 '17 at 15:53
thanks, at least closing the lid dont suspends the notebook anymore. but now it really does "nothing" but turning the screen of. after reopening the screen is not locked and i dont need my password. (like usual before 17.10). maybe someone knows how to change this via terminal?
– JohnDabc
Nov 2 '17 at 15:53
I appended few additional steps. Can you check and confirm?
– Legolas
Nov 2 '17 at 17:48
I appended few additional steps. Can you check and confirm?
– Legolas
Nov 2 '17 at 17:48
No. first editing wasn't so easy, since everythings different with 17.10, solution: "sudo gedit admin:///etc/systemd/logind.conf" (via askubuntu.com/a/968196/755218 ) now the last line of the saved file is "HandleLidSwitch=lock". hand to do a hard poweroff after running the command, but when i now close the lid nothing changes.
– JohnDabc
Nov 3 '17 at 13:00
No. first editing wasn't so easy, since everythings different with 17.10, solution: "sudo gedit admin:///etc/systemd/logind.conf" (via askubuntu.com/a/968196/755218 ) now the last line of the saved file is "HandleLidSwitch=lock". hand to do a hard poweroff after running the command, but when i now close the lid nothing changes.
– JohnDabc
Nov 3 '17 at 13:00
I have added the exact content of my file in the answer. I have checked it, this works, and yes you would have to do a hard reboot.
– Legolas
Nov 3 '17 at 14:27
I have added the exact content of my file in the answer. I have checked it, this works, and yes you would have to do a hard reboot.
– Legolas
Nov 3 '17 at 14:27
2
2
No don't works with me, this is how the file looks after editing and still after reboot: i.stack.imgur.com/o9d9P.png
– JohnDabc
Nov 3 '17 at 15:11
No don't works with me, this is how the file looks after editing and still after reboot: i.stack.imgur.com/o9d9P.png
– JohnDabc
Nov 3 '17 at 15:11
|
show 5 more comments
up vote
1
down vote
You could install dconf-editor
to change what happens when lid is closed.
sudo apt-get install dconf-editor
go to org.gnome.settings-daemon.plugins.power
in dconf-editor
. you can change the value of lid-close-ac-action
and lid-close-battery-action
for changing the action when lid closed.The possible values are 'suspend','hibernate','logout','shutdown','nothing'.
Via CLI would be:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action suspend
add a comment |
up vote
1
down vote
You could install dconf-editor
to change what happens when lid is closed.
sudo apt-get install dconf-editor
go to org.gnome.settings-daemon.plugins.power
in dconf-editor
. you can change the value of lid-close-ac-action
and lid-close-battery-action
for changing the action when lid closed.The possible values are 'suspend','hibernate','logout','shutdown','nothing'.
Via CLI would be:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action suspend
add a comment |
up vote
1
down vote
up vote
1
down vote
You could install dconf-editor
to change what happens when lid is closed.
sudo apt-get install dconf-editor
go to org.gnome.settings-daemon.plugins.power
in dconf-editor
. you can change the value of lid-close-ac-action
and lid-close-battery-action
for changing the action when lid closed.The possible values are 'suspend','hibernate','logout','shutdown','nothing'.
Via CLI would be:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action suspend
You could install dconf-editor
to change what happens when lid is closed.
sudo apt-get install dconf-editor
go to org.gnome.settings-daemon.plugins.power
in dconf-editor
. you can change the value of lid-close-ac-action
and lid-close-battery-action
for changing the action when lid closed.The possible values are 'suspend','hibernate','logout','shutdown','nothing'.
Via CLI would be:
gsettings set org.gnome.settings-daemon.plugins.power lid-close-battery-action suspend
edited Oct 17 at 19:20
Pablo Bianchi
2,2131528
2,2131528
answered Mar 30 at 7:38
Vivin Veerali
111
111
add a comment |
add a comment |
up vote
1
down vote
In Ubuntu 18.04 Gnome desktop, there is no option in the Settings utility for configuring the laptop lid close actions. And Gnome Tweaks only offers a switch to enable / disable the "Suspend when laptop lid is closed" option.
For those who want it to shut down automatically, hibernate, or do nothing when the laptop lid is closed, here’s how to do it by hacking the configuration file:
Open a terminal by pressing Ctrl+Alt+T or searching for “Terminal” from start menu. When it opens, run the following command:
sudo gedit /etc/systemd/logind.conf
When the files opens, uncomment the line
#HandleLidSwitch=suspend
by removing#
in the beginning, and change the value to :
HandleLidSwitch=poweroff
: shutdown / power off when lid is closed.
HandleLidSwitch=hibernate
: hibernate when lid is closed (need to test
if hibernate works).
HandleLidSwitch=ignore
: do nothing.
HandleLidSwitch=suspend
: suspend laptop when lid is closed.
Save the file and finally restart the Systemd service to apply changes via command:
systemctl restart systemd-logind.service
Source
New contributor
1
LuFFy: An edit and an upvote. Use 8 spaces instead of 4 when you're indenting or using numbered or bulleted lists. have a look at my edits to see how I did it... ;-)
– Fabby
Nov 30 at 10:25
1
Thanks @Fabby, I will keep in mind that.
– LuFFy
Nov 30 at 11:27
add a comment |
up vote
1
down vote
In Ubuntu 18.04 Gnome desktop, there is no option in the Settings utility for configuring the laptop lid close actions. And Gnome Tweaks only offers a switch to enable / disable the "Suspend when laptop lid is closed" option.
For those who want it to shut down automatically, hibernate, or do nothing when the laptop lid is closed, here’s how to do it by hacking the configuration file:
Open a terminal by pressing Ctrl+Alt+T or searching for “Terminal” from start menu. When it opens, run the following command:
sudo gedit /etc/systemd/logind.conf
When the files opens, uncomment the line
#HandleLidSwitch=suspend
by removing#
in the beginning, and change the value to :
HandleLidSwitch=poweroff
: shutdown / power off when lid is closed.
HandleLidSwitch=hibernate
: hibernate when lid is closed (need to test
if hibernate works).
HandleLidSwitch=ignore
: do nothing.
HandleLidSwitch=suspend
: suspend laptop when lid is closed.
Save the file and finally restart the Systemd service to apply changes via command:
systemctl restart systemd-logind.service
Source
New contributor
1
LuFFy: An edit and an upvote. Use 8 spaces instead of 4 when you're indenting or using numbered or bulleted lists. have a look at my edits to see how I did it... ;-)
– Fabby
Nov 30 at 10:25
1
Thanks @Fabby, I will keep in mind that.
– LuFFy
Nov 30 at 11:27
add a comment |
up vote
1
down vote
up vote
1
down vote
In Ubuntu 18.04 Gnome desktop, there is no option in the Settings utility for configuring the laptop lid close actions. And Gnome Tweaks only offers a switch to enable / disable the "Suspend when laptop lid is closed" option.
For those who want it to shut down automatically, hibernate, or do nothing when the laptop lid is closed, here’s how to do it by hacking the configuration file:
Open a terminal by pressing Ctrl+Alt+T or searching for “Terminal” from start menu. When it opens, run the following command:
sudo gedit /etc/systemd/logind.conf
When the files opens, uncomment the line
#HandleLidSwitch=suspend
by removing#
in the beginning, and change the value to :
HandleLidSwitch=poweroff
: shutdown / power off when lid is closed.
HandleLidSwitch=hibernate
: hibernate when lid is closed (need to test
if hibernate works).
HandleLidSwitch=ignore
: do nothing.
HandleLidSwitch=suspend
: suspend laptop when lid is closed.
Save the file and finally restart the Systemd service to apply changes via command:
systemctl restart systemd-logind.service
Source
New contributor
In Ubuntu 18.04 Gnome desktop, there is no option in the Settings utility for configuring the laptop lid close actions. And Gnome Tweaks only offers a switch to enable / disable the "Suspend when laptop lid is closed" option.
For those who want it to shut down automatically, hibernate, or do nothing when the laptop lid is closed, here’s how to do it by hacking the configuration file:
Open a terminal by pressing Ctrl+Alt+T or searching for “Terminal” from start menu. When it opens, run the following command:
sudo gedit /etc/systemd/logind.conf
When the files opens, uncomment the line
#HandleLidSwitch=suspend
by removing#
in the beginning, and change the value to :
HandleLidSwitch=poweroff
: shutdown / power off when lid is closed.
HandleLidSwitch=hibernate
: hibernate when lid is closed (need to test
if hibernate works).
HandleLidSwitch=ignore
: do nothing.
HandleLidSwitch=suspend
: suspend laptop when lid is closed.
Save the file and finally restart the Systemd service to apply changes via command:
systemctl restart systemd-logind.service
Source
New contributor
edited Nov 30 at 10:21
Fabby
26k1360159
26k1360159
New contributor
answered Nov 30 at 7:10
LuFFy
1114
1114
New contributor
New contributor
1
LuFFy: An edit and an upvote. Use 8 spaces instead of 4 when you're indenting or using numbered or bulleted lists. have a look at my edits to see how I did it... ;-)
– Fabby
Nov 30 at 10:25
1
Thanks @Fabby, I will keep in mind that.
– LuFFy
Nov 30 at 11:27
add a comment |
1
LuFFy: An edit and an upvote. Use 8 spaces instead of 4 when you're indenting or using numbered or bulleted lists. have a look at my edits to see how I did it... ;-)
– Fabby
Nov 30 at 10:25
1
Thanks @Fabby, I will keep in mind that.
– LuFFy
Nov 30 at 11:27
1
1
LuFFy: An edit and an upvote. Use 8 spaces instead of 4 when you're indenting or using numbered or bulleted lists. have a look at my edits to see how I did it... ;-)
– Fabby
Nov 30 at 10:25
LuFFy: An edit and an upvote. Use 8 spaces instead of 4 when you're indenting or using numbered or bulleted lists. have a look at my edits to see how I did it... ;-)
– Fabby
Nov 30 at 10:25
1
1
Thanks @Fabby, I will keep in mind that.
– LuFFy
Nov 30 at 11:27
Thanks @Fabby, I will keep in mind that.
– LuFFy
Nov 30 at 11:27
add a comment |
up vote
0
down vote
Install gnome-tweaks
sudo apt-get install gnome-tweaks
and invoke it with
gnome-tweaks
Under the menu Power you can disable Suspend when laptop lid is closed.
add a comment |
up vote
0
down vote
Install gnome-tweaks
sudo apt-get install gnome-tweaks
and invoke it with
gnome-tweaks
Under the menu Power you can disable Suspend when laptop lid is closed.
add a comment |
up vote
0
down vote
up vote
0
down vote
Install gnome-tweaks
sudo apt-get install gnome-tweaks
and invoke it with
gnome-tweaks
Under the menu Power you can disable Suspend when laptop lid is closed.
Install gnome-tweaks
sudo apt-get install gnome-tweaks
and invoke it with
gnome-tweaks
Under the menu Power you can disable Suspend when laptop lid is closed.
answered Jun 16 at 10:37
abu_bua
3,10081023
3,10081023
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f972169%2fubuntu-17-10-and-later-dont-suspend-when-lid-is-closed-just-lock-screen%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I have posted a Gnome bug report, please also support adding this to settings, I have bad experiences with them and having lots of people asking for it might help. Here it is: bugzilla.gnome.org/show_bug.cgi?id=790043
– conualfy
Nov 8 '17 at 4:46
To JohnDabc: it seems that you did not follow Legolas's instructions. In order your system to lock when you close the lid, you MUST undo the tweak (that is to Launch Tweaks, go to the "Power" section and ENABLE suspend on lid-close). To cboettig: yes, it is possible using the same method (changing the logind.conf file). You must add the lines below in /etc/systemd/logind.conf [Login] HandleLidSwitch=lock HandleLidSwitchDocked=ignore
– Chris.p
Dec 11 '17 at 16:01
@Chris.p I have Unity Tweak Tool 0.0.7 . I don't see a "Power" section. I have four major areas [Unity, Window Manager, Appearance, System]. None of them has a section called "Power".
– Scooter
Jan 28 at 1:19