How to setup ubuntu to not shutdown when closing the lid, while connected to an external monitor

linux
Upower.conf
linux setup configs
Author

fastdaima

Published

December 4, 2024

How to do it

  • When connecting an laptop to an monitor and if you want to only show display on the external monitor, you tend to close the laptop lid.
  • By default, ubuntu shutsdown the system / goes into hibernation mode.
  • This can be avoided by changing a config in /etc/UPower/UPower.conf.
  • open in your favourite text editor, since its a system file, you need an root access say sudo vim /etc/UPower/UPower.conf
  • search for IgnoreLid and make it to true like: IgnoreLid=True and save it
  • reload the power service by, sudo service upower restart