LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-28-2016, 05:40 AM   #1
aldorgan
LQ Newbie
 
Registered: Jul 2016
Posts: 15

Rep: Reputation: Disabled
Slackware 14.2 - how to suspend when closing the lid on the laptop?


how to suspend when closing the lid on the laptop? As of now nothing happens at all, the computer is still on.
 
Old 07-28-2016, 05:43 AM   #2
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
I use KDE, there it 'just works'
you might want to fine adjust KDE settings in system settings, power management
there you can define you actions what happens if you close the laptop lid.
 
Old 07-28-2016, 06:01 AM   #3
aldorgan
LQ Newbie
 
Registered: Jul 2016
Posts: 15

Original Poster
Rep: Reputation: Disabled
Ok i'm using i3 window manager, so maybe i need todo something to get it to work.
 
Old 07-28-2016, 07:31 AM   #4
imitis
Member
 
Registered: Oct 2007
Location: Latvia, Liepaja
Distribution: Slackware
Posts: 92

Rep: Reputation: 29
Hi. Just create file /etc/acpi/events/lid

Code:
event=button/lid (LID)
action=/usr/sbin/pm-suspend
 
1 members found this post helpful.
Old 07-28-2016, 09:02 AM   #5
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
You can also add "pm-suspend" and "pm-hibernate" to you sudoers configuration and execute suspend/hibernate from a terminal window. I do not run i3wm, but this method works well in Fluxbox.

Code:
xlock & sleep 5 ; sudo pm-suspend
or

Code:
xlock & sleep 5 ; sudo pm-hibernate

If you have an encrypted hard drive, there is no need for the "xlock & sleep5" portion since a password is required when resuming the OS from a hibernate. It still applies though if you are running "pm-suspend."

Last edited by mralk3; 07-28-2016 at 09:04 AM.
 
1 members found this post helpful.
Old 07-28-2016, 03:33 PM   #6
aldorgan
LQ Newbie
 
Registered: Jul 2016
Posts: 15

Original Poster
Rep: Reputation: Disabled
imitis: Thank you! that solved my problem, now when i close the lid it goes to suspend mode
 
Old 09-05-2016, 10:45 PM   #7
ewlabonte
Member
 
Registered: Mar 2005
Distribution: Debian Stretch
Posts: 127

Rep: Reputation: 15
Quote:
Originally Posted by imitis View Post
Hi. Just create file /etc/acpi/events/lid

Code:
event=button/lid (LID)
action=/usr/sbin/pm-suspend
I tried this but with pm-hibernate instead of pm-suspend. It does hibernate when I close the lid, but when it resumes, it shuts down again within a few seconds and I have to start it again. It then resumes to the state I left it, but I have to start it twice.
 
Old 09-05-2016, 10:56 PM   #8
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware64
Posts: 583

Rep: Reputation: 242Reputation: 242Reputation: 242
ewlabonte,
I use pm-suspend. You might have a look at my solution here:
https://www.linuxquestions.org/quest...6/#post5587173

I think you might need not only a "lid close" but a "lid open" script as well.
Obviously my solution is different, but you might be able to edit things to suit your use case.
HTH
 
2 members found this post helpful.
Old 09-05-2016, 11:27 PM   #9
ewlabonte
Member
 
Registered: Mar 2005
Distribution: Debian Stretch
Posts: 127

Rep: Reputation: 15
Thank you, that was it.

event=button/lid LID close
action=/usr/sbin/pm-hibernate

works.

Thanks for your response.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
logind.conf not working, closing lid will not suspend laptop 4art4 Linux - Laptop and Netbook 3 08-18-2015 06:26 PM
Hp 15 laptop with Mint 17- closing lid Suspend) dose not reduce power usage abbarnett Linux - Laptop and Netbook 1 10-03-2014 02:48 PM
screen hanging after closing laptop lid makaukelvin Linux - Laptop and Netbook 1 04-27-2012 08:50 PM
[SOLVED] how can I prevent my laptop from suspend or hibernate when closing its lid? TroN-0074 Linux - Newbie 8 03-31-2012 09:35 AM
How to suspend on lid closing? jerrybasham Linux - Laptop and Netbook 4 06-29-2007 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration