6

The power category in GNOME Tweaks only show a "suspend when laptop lid is closed". However, there is no distinction between whether the laptop is plugged (for instance to a docking station or a charger) or operating on battery power.

In my case, I would like my laptop to suspend when closing the lid on battery power, but leave it when plugged to its charger. Is there a way to achieve that?

ghisvail
  • 128
  • 8

1 Answers1

2

You can set this using dconf-editor.

Install it:

sudo apt-get install dconf-editor

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

You will be able to choose separate actions for lid-close-ac-action and lid-close-battery-action

Yaksha
  • 1,740
  • This didn't work for me in 17.10, I set lid-close-ac-action to 'blank' but the machine still suspends when the lid is closed while powered. – freddybob Oct 28 '17 at 14:21
  • May be you should reboot and then check – Yaksha Oct 28 '17 at 17:07
  • @freddybob, If it does not work, then you should try this answer: https://askubuntu.com/a/425032/574724 – Yaksha Oct 28 '17 at 17:15
  • thanks that worked (although, of course, now it does not suspend when the lid is closed whether or not it is plugged in). – freddybob Nov 18 '17 at 17:54