16.04 - When laptop lid is closed, the desktop switches to external monitor

When I close my laptop lid, I want that the laptop suspends.
I already set the power settings to "suspend" as shown in the linked picture (language is set to german).
But instead of going into suspend mode, the desktop switches to the external monitor.
How can I prevent that?

Power settings


Solution 1:

If not already installed, install the dconf-editor, you can find it in the software center or in the terminal:

sudo apt-get install dconf-editor

Open it and navigate to:

org >> gnome >> settings-daemon >> plugins >> power

Activate the following checkbox and exit dconf-editor:

lid-close-suspend-with-external-monitor


Update: If the above instructions don't show the desired effect, open the following file:

gksudo gedit /etc/systemd/logind.conf

Uncomment (remove the # in) the following line and set it to 'suspend' instead of 'ignore':

HandleLidSwitchDocked=suspend

Save, Exit and Reboot