Suspend on lid-close

Archived topics about LMDE 1
Forum rules
firefexx
Level 1
Level 1
Posts: 2
Joined: Thu Jun 19, 2014 3:28 pm

Suspend on lid-close

Postby firefexx » Thu Jun 19, 2014 3:35 pm

Hi,

I recently installed LMDE with Cinnamon and observed some strange behaviour concerning suspend.
When logged in as a user, suspend when closing laptop-lid works as expected.
But when nobody is logged in, i.e. the log in screen is visible, nothing happens when closing the laptop-lid.

Could someone assist in fixing this issue?

Monsta
Level 9
Level 9
Posts: 2928
Joined: Fri Aug 19, 2011 3:46 am

Re: Suspend on lid-close

Postby Monsta » Mon Jun 23, 2014 9:43 am

firefexx wrote:But when nobody is logged in, i.e. the log in screen is visible, nothing happens when closing the laptop-lid.

When nobody is logged in, it's MDM that's active, not Cinnamon. You may try another display manager (e.g. LightDM) for experiment.

firefexx
Level 1
Level 1
Posts: 2
Joined: Thu Jun 19, 2014 3:28 pm

Re: Suspend on lid-close

Postby firefexx » Thu Aug 07, 2014 2:29 pm

Thank you for your answer, but lightdm doesn't suspend on lid-close, too.
lightdm works for me under Fedora but not with LMDE.

chrisonmint
Level 3
Level 3
Posts: 122
Joined: Sun May 03, 2015 10:49 am

Re: Suspend on lid-close

Postby chrisonmint » Sun May 17, 2015 4:49 am

firefexx wrote:Hi,

I recently installed LMDE with Cinnamon and observed some strange behaviour concerning suspend.
When logged in as a user, suspend when closing laptop-lid works as expected.
But when nobody is logged in, i.e. the log in screen is visible, nothing happens when closing the laptop-lid.

Could someone assist in fixing this issue?


This problem was annoying me too, so I did a bit of looking around. Linux mint uses the "mint display manager" aka MDM and I found that there are some terminal commands and config files which will solve this for you.

'logind' is the command line tool which handles the login screen. It has a config file here /etc/systemd/logind.conf and you can read about all the different options in a terminal window by typing

Code: Select all

man logind.conf


The important line(s) for us are the following. In the default setup, all are set to 'ignore'. I changed the lid switch and power button to read 'suspend':

Code: Select all

HandlePowerKey=suspend
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=suspend


For each option, you can choose from:
ignore, poweroff, reboot, halt, kexec, suspend, hibernate, hybrid-sleep and lock

You will need to edit the conf file as root, so type the following:

Code: Select all

sudo pico /etc/systemd/logind.conf

- if you are not familiar with pico (or its cousin, nano which is also installed) then I strongly recommend it. Much simpler than vi, although less powerful. Its a simple text editor and when you are finished, type ctrl-o to save the file and then ctrl-x to exit.

User avatar
Pjotr
Level 16
Level 16
Posts: 6296
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Suspend on lid-close

Postby Pjotr » Sun May 17, 2015 4:51 am

@chrisonmint: thanks for this cool solution! :)
Tip: 10 things to do after installing Linux Mint 18 Sarah
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 0 guests