Enable suspend on lid close?

Post here if you are a new Porteus member and you're looking for some help.
kentchristopher
Ronin
Ronin
Posts: 2
Joined: 10 Jan 2014, 03:41
Distribution: Porteus 2.0
Location: Earth

Enable suspend on lid close?

Post#1 by kentchristopher » 10 Jan 2014, 03:45

I'm using the latest Porteus on a Thinkpad T41 as a permanent installation (in frugal mode) on the hard drive. It seems a perfect use for such a nice, light, Linux OS.

However, I've noticed that the laptop doesn't go into suspend when the lid is closed. I've looked in the power settings, and for a related package to install (searching the packages with keyword "power"), but so far haven't come up with a solution. Is it possible to enable this function in Porteus?

Thanks in advance.

User avatar
francois
Contributor
Contributor
Posts: 4984
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: Enable suspend on lid close?

Post#2 by francois » 10 Jan 2014, 04:57

In the kde desktop:
kde panel > applications > settings > kde settings > energy saving > button event handling > sleep
Voltaire: Le mieux est l'ennemi du bien.

kentchristopher
Ronin
Ronin
Posts: 2
Joined: 10 Jan 2014, 03:41
Distribution: Porteus 2.0
Location: Earth

Re: Enable suspend on lid close?

Post#3 by kentchristopher » 10 Jan 2014, 05:10

Is it also possible in LXDE? (Sorry, should have specified that.)

User avatar
fanthom
Site Admin
Site Admin
Posts: 4587
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Enable suspend on lid close?

Post#4 by fanthom » 10 Jan 2014, 08:45

with LXDE you will have to use acpid events directly. please have a look here:
https://wiki.archlinux.org/index.php/acpid
https://bbs.archlinux.org/viewtopic.php?id=94516

in slackware you will have to modify /etc/acpi/acpi_handler.sh file.
Please add [Solved] to your thread title if the solution was found.

User avatar
Ed_P
Contributor
Contributor
Posts: 3201
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Enable suspend on lid close?

Post#5 by Ed_P » 10 Jan 2014, 16:26

fanthom wrote:in slackware you will have to modify /etc/acpi/acpi_handler.sh file.
RazorQT has the same situation. What exact modification do you suggest to the acpi_handler.sh file to resolve this problem? Or is there another way?
Ed

User avatar
francois
Contributor
Contributor
Posts: 4984
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: Enable suspend on lid close?

Post#6 by francois » 10 Jan 2014, 17:38

What is the advantage of the sleep mode? Isn't it better to completely shutdown given the speed at which porteus bootup and shutdown? There are very interesting answers here:
http://www.brighthub.com/environment/gr ... 95215.aspx
Voltaire: Le mieux est l'ennemi du bien.

User avatar
Ed_P
Contributor
Contributor
Posts: 3201
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Enable suspend on lid close?

Post#7 by Ed_P » 10 Jan 2014, 18:27

francois wrote:Isn't it better to completely shutdown given the speed at which porteus bootup and shutdown?
So long as the shutdown happens automatically when the lid is closed and changes get saved to the save.dat file it probably doesn't matter if shutdown is used instead of suspend. Currently neither happens when the lid is closed which eats the remaining battery life.
Ed

User avatar
phhpro
Full of knowledge
Full of knowledge
Posts: 545
Joined: 10 Nov 2013, 20:35
Distribution: .

Re: Enable suspend on lid close?

Post#8 by phhpro » 11 Jan 2014, 02:43

...
Last edited by phhpro on 03 Feb 2016, 23:43, edited 1 time in total.

User avatar
Ed_P
Contributor
Contributor
Posts: 3201
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Enable suspend on lid close?

Post#9 by Ed_P » 11 Jan 2014, 05:01

phhpro wrote:What I usually do, is to hit the appropiate button on the keyboard.
Image What button are you referring to that hibernates the system? Or saves the system's changes then shuts the laptop down? Your posting is kinda vague.
Ed

User avatar
fanthom
Site Admin
Site Admin
Posts: 4587
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Enable suspend on lid close?

Post#10 by fanthom » 11 Jan 2014, 09:45

What button are you referring to that hibernates the system? Or saves the system's changes then shuts the laptop down? Your posting is kinda vague.
i have given you a fishing rod and not a fish itself. dont be lazy and read linked doc then create proper action in your /etc/acpi/acpi_handler.sh file.
to get you closer:
https://wiki.archlinux.org/index.php/ac ... _Power_Off
and how to do a suspend?

Code: Select all

echo -n mem > /sys/power/state
Please add [Solved] to your thread title if the solution was found.

User avatar
francois
Contributor
Contributor
Posts: 4984
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: Enable suspend on lid close?

Post#11 by francois » 11 Jan 2014, 16:00

Ed_P wrote:
phhpro wrote:What I usually do, is to hit the appropiate button on the keyboard.
Image What button are you referring to that hibernates the system? Or saves the system's changes then shuts the laptop down? Your posting is kinda vague.
He is talking about the power button that performs automatically a shutdown of the os under porteus. This is one of its great features. 8)
Voltaire: Le mieux est l'ennemi du bien.

User avatar
phhpro
Full of knowledge
Full of knowledge
Posts: 545
Joined: 10 Nov 2013, 20:35
Distribution: .

Re: Enable suspend on lid close?

Post#12 by phhpro » 11 Jan 2014, 23:30

...
Last edited by phhpro on 03 Feb 2016, 23:43, edited 1 time in total.

User avatar
francois
Contributor
Contributor
Posts: 4984
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: Enable suspend on lid close?

Post#13 by francois » 12 Jan 2014, 03:03

... that performs automatically a shutdown of the os under porteus. ... it should save your current desktop data. :D
Voltaire: Le mieux est l'ennemi du bien.

User avatar
Ed_P
Contributor
Contributor
Posts: 3201
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: Enable suspend on lid close?

Post#14 by Ed_P » 12 Jan 2014, 04:42

fanthom wrote:i have given you a fishing rod and not a fish itself. dont be lazy and read linked doc then create proper action in your /etc/acpi/acpi_handler.sh file.
:) LOL Thank you fanthom. I will, I promise.
fanthom wrote:to get you closer:
https://wiki.archlinux.org/index.php/ac ... _Power_Off
and how to do a suspend?

Code: Select all

echo -n mem > /sys/power/state
Thank you fanthom. :beer:
francois wrote:He is talking about the power button that performs automatically a shutdown of the os under porteus. This is one of its great features. 8)
I think you're right neighbor.
phhpro wrote:@ed_p: The power button is one way. Depending your hardware, there may be a special button or key-combo specifically for that purpose. Usually you'd have to hit the FN key together with the special key, at least on Dell and HP. Dell even prints Hibernate on the F1 key, so hitting FN+F1=Hibernate. I find the power button a lot easier ;)
I suspected you were referring to the power button, rather than a key, but it doesn't save the session or the save.dat file updates. The Fn+ keys do hibernate Windows sessions but have no effect on Porteus.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 5503
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Enable suspend on lid close?

Post#15 by brokenman » 12 Jan 2014, 13:16

A little off topic but on my system sleep & hibernate are borked. Some ACPI problem. Works fine on my wife's laptop.

Since i am usually in the terminal i shut down using: init 0
In Porteus -v3.0rc1 my system goes down in less than 3 seconds! To boot up is less than 20 seconds.

This sounds good, but the other night i was tired and after 6 hours of coding i mindlessly typed the shutdown command before saving my work. I realized i hadn't saved as my finger was falling helplessly towards the enter button. Time slowed down for a brief second and my catlike reflexes kicked into action. My finger clipped the enter button, and i blinked twice. Too late, all was lost. Damn you Pooorteusss!
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply