2

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
  • 391
  • 1
  • 3
  • 10
  • Check out this thread https://askubuntu.com/questions/15520/how-can-i-tell-ubuntu-to-do-nothing-when-i-close-my-laptop-lid – Richard Logwood Aug 11 '20 at 21:25
  • Does this answer your question? [When laptop lid is closed, the desktop switches to external monitor (Ubuntu 20.04 Gnome)](https://askubuntu.com/questions/1355031/when-laptop-lid-is-closed-the-desktop-switches-to-external-monitor-ubuntu-20-0) – user68186 Nov 11 '22 at 20:41
  • Neither of these comments answer the OP's question, if you read them closely, at least as I can see. The question is not a duplicate. – C.S.Cameron Nov 12 '22 at 03:49

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,583
  • 13
  • 22
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.

user284445
  • 231
  • 2
  • 7