Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to hibernate when I close the lid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Andrey Grozin
n00b
n00b


Joined: 12 Nov 2015
Posts: 6

PostPosted: Mon Oct 21, 2024 4:00 pm    Post subject: How to hibernate when I close the lid Reply with quote

I've bought a new notebook (asus vivobook) and installed gentoo. I want the system to hibernate when I close the lid. I've installed hibernate-scripts; when I do (as root)
Code:
hibernate

it hibernates fine, when I switch it on again, everything is restored. But I want to be able to do it quickly, without su and typing the root password, just by closing the lid. I've edited /etc/elogind/logind.conf to contain
Code:
HandleLidSwitch=hibernate
HandleLidSwitchExternalPower=hibernate

But this does not work: when I close the lid, the notebook continues to work. Is it possible to instruct elogind to call /usr/bin/hibernate when I close the lid?
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 614

PostPosted: Mon Oct 21, 2024 5:27 pm    Post subject: Re: How to hibernate when I close the lid Reply with quote

Andrey Grozin wrote:
Is it possible to instruct elogind to call /usr/bin/hibernate when I close the lid?
Yeah, if you look up the "Hook Directories" section in man loginctl you can put scripts to be run on "system-sleep" in there. It's worth checking if loginctl hibernate works first though, if it does it could indicate elogind isn't seeing the lid close event at all.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum