15.04, 15.10, 16.04 - Closing lid does not suspend laptop if connected to external monitor

Since the upgrade to 15.04 (update: 15.10 still same), my laptop's behavior on closing lid has changed: if it is connected to an external monitor, it will not suspend. In addition, all the windows are now flushed to the external monitor. This seems like a deliberate feature and not a bug.

How do I configure the laptop to suspend even if it's connected to an external monitor?

This is Lenovo Thinkpad T440s on Ubuntu 15.04/15.10 with Intel graphics.


I think this feature is now configurable. You can change the option as user with the dconf-editor:

Schema:

org.cinnamon.settings-daemon.plugins.power

or (depending on what desktop environment you use)

org.gnome.settings-daemon.plugins.power

Key:

lid-close-suspend-with-external-monitor

Set to:

true

Description:

With no external monitors plugged in, closing a laptop's lid will suspend the machine (as set by the lid-close-battery-action and lid-close-ac-action keys). By default, however, closing the lid when an external monitor is present will not suspend the machine, so that one can keep working on that monitor (e.g. for docking stations or media viewers). Set this key to False to keep the default behavior, or to True to suspend the laptop whenever the lid is closed and regardless of external monitors.


Welcome to Ubuntu with systemd rather than with upstart.

This is systemd bug #76267. Lennart Poettering's initial explanation was:

The [nvidia] binary driver does not implement the DRM interfaces in /sys. This means we cannot detect how many displays are connected and then we decide not to handle the lid switch since we cannot be sure about whether the device is in "docking" mode, or not.

A "fix" is to use nouveau.

Because of systemd bug #82485 this behaviour is now configurable. If you have a non-DRM driver, like the nvidia one, the default behaviour with multiple monitors will be to ignore the lid switch. But the recent HandleLidSwitchDocked setting in logind.conf can be used to change this.

(For completeness: There is GNOME bug #734964, still open, that introduces complications for GNOME 3 users.)


I ran into the same problem upgrading from 14.10 to 15.04 (Xubuntu). Although I was using Nouveau (Xorg driver), I wasn't able to go into Suspend mode closing the lid. Every other way worked just fine e.g. "Sleep Button", "Suspend" from Menu etc.

My workaround was to uncheck the following option in gnome-settings (a.k.a Settings Editor):

xfce4-power-manager > logind-handle-lid-switch (unchecked)

After doing this I can suspend closing my lid anytime.

Hope that helps.


This is a new systemd default which is not configurable yet.

To Workaround, type in a terminal

echo "HandleLidSwitchDocked=suspend" |sudo tee -a /etc/systemd/logind.conf

then reboot(!).

This changes the default from "ignore" to "suspend".