4

When I use an external monitor the laptop does not automatically suspend when I close the lid. Instead the external monitor is then still in use.

I want to configure ubuntu in such a way that the laptop always suspends when I close the lid. Regardless of whether I use an external monitor or not.

I read on logind.conf: If the system is inserted in a docking station, or if more than one display is connected, the action specified by HandleLidSwitchDocked= occurs.

But setting it to suspend didn't work for me.

Whack
  • 421
  • 1
  • 4
  • 10

2 Answers2

0

All Ubuntus

Open dconf editor, and modify the setting:

/org/gnome/settings-daemon/plugins/power/lid-close-suspend-with-external-monitor

to yes

Ubuntu 20.04 (logind based)

Modify /etc/systemd/logind.conf and put value of HandleLidSwitchDocked with suspend, ending them like:

HandleLidSwitchDocked=suspend

Ubuntu 22.04 (Upower based)

Modify the line in /etc/UPower/UPower.conf as follows (yes, this step sounds weird):

IgnoreLid=true

EVERYONE

Reboot and enjoy your laptop more!

based on. https://askubuntu.com/a/1356494/170833

morhook
  • 1,610
  • 14
  • 23
0

IgnoreLid=true may no longer work in 22.04, at least it does not for me.

It's unclear to me if the commits mentioned here are released or not, but the intention seems to be for upower to leave this to systemd-logind

See my question here.