Ubuntu – Disable suspend after screen lock

laptoplock-screenpower-managementsuspend

I use Ubuntu 16.10 on a laptop (with closed lid) which is attached to a docking station and an external monitor.

After I lock (i.e. through ctrl+alt+l) my machine, ubuntu suspends itself after a few minutes. How can I disable this behavior?

I am aware of the Power options in the System Settings. My choices are as follows:enter image description here
Maybe the problem could be solved by disabling "suspend when lid is closed" (as technically, the lid is closed when the device is attached to the docking station).
However, I would prefer to keep the "suspend when lid is closed" option since I also use the laptop without the docking station.

Thanks for your help!

Best Answer

You can try this. Open the terminal and type:

gksu gedit /etc/systemd/logind.conf

Set these two lines to look like this:

HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore

Save the file, reboot and test it under the two environments (docked and undocked).

If unacceptable results, change your power settings to "Do nothing" on the lid close event where you have it set to "Suspend" now. You shouldn't have to reboot to test your two environments again.

Related Question