Suspend on lid-close

All Gurus once were Newbies
Forum rules

Suspend on lid-close

Postby firefexx on 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?
firefexx
Level 1
Level 1
 
Posts: 2
Joined: Thu Jun 19, 2014 3:28 pm

Linux Mint is funded by ads and donations.
 

Re: Suspend on lid-close

Postby Monsta on 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.
Monsta
Level 9
Level 9
 
Posts: 2893
Joined: Fri Aug 19, 2011 3:46 am

Re: Suspend on lid-close

Postby firefexx on 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.
firefexx
Level 1
Level 1
 
Posts: 2
Joined: Thu Jun 19, 2014 3:28 pm

Re: Suspend on lid-close

Postby chrisonmint on 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.
chrisonmint
Level 2
Level 2
 
Posts: 92
Joined: Sun May 03, 2015 10:49 am

Re: Suspend on lid-close

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

@chrisonmint: thanks for this cool solution! :)
Tip: 10 things to do after installing Linux Mint 17.3 Rosa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Everything can be cracked, nothing is entirely secure, so strive for as much nothing as possible....
User avatar
Pjotr
Level 13
Level 13
 
Posts: 4892
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 3 guests