LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 06: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, 06:43 AM   #2
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739
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, 07: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, 08:31 AM   #4
imitis
Member
 
Registered: Oct 2007
Location: Latvia, Liepaja
Distribution: Slackware
Posts: 57

Rep: Reputation: 8
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, 10:02 AM   #5
mralk3
Senior Member
 
Registered: May 2015
Location: Utah, USA
Distribution: Slackware 14.2 || Slackware-current && CentOS
Posts: 1,317

Rep: Reputation: 694Reputation: 694Reputation: 694Reputation: 694Reputation: 694Reputation: 694
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 10:04 AM.
 
1 members found this post helpful.
Old 07-28-2016, 04: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, 11:45 PM   #7
ewlabonte
Member
 
Registered: Mar 2005
Distribution: FreeSlack version of Slackware 14.1
Posts: 107

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, 11:56 PM   #8
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware -current 32bit!
Posts: 537

Rep: Reputation: 202Reputation: 202Reputation: 202
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-06-2016, 12:27 AM   #9
ewlabonte
Member
 
Registered: Mar 2005
Distribution: FreeSlack version of Slackware 14.1
Posts: 107

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

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

works.

Thanks for your response.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07: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 03:48 PM
screen hanging after closing laptop lid makaukelvin Linux - Laptop and Netbook 1 04-27-2012 09: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 10:35 AM
How to suspend on lid closing? jerrybasham Linux - Laptop and Netbook 4 06-29-2007 01:03 PM

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

All times are GMT -5. The time now is 11:16 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration