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: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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
Prendre son temps, profiter de celui qui passe.

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
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
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: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 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: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

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
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 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
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Enable suspend on lid close?

Post#8 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
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Enable suspend on lid close?

Post#9 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: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: Enable suspend on lid close?

Post#10 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)
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: Enable suspend on lid close?

Post#11 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
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Enable suspend on lid close?

Post#12 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: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Enable suspend on lid close?

Post#13 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.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Enable suspend on lid close?

Post#14 by Ed_P » 12 Jan 2014, 20:47

brokenman wrote: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!
Image Sorry you lost your work but I do like your literary style. Image
Ed

tome
Contributor
Contributor
Posts: 675
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Russia is causing the immense damage to humanity
Contact:

Re: Enable suspend on lid close?

Post#15 by tome » 12 Jan 2014, 21:31

Ed_P
maybe you should create launcher for suspend and eventually assign some keys to execute this, you can see also: forum.porteus.org/viewtopic.php?f=39&t=2839

brokenman
I had fear of this (we do sth quicker than we think about this out of habit) and now I use fresh mode for settings but for other folders or files I have links to real filesystem. If one of main maintainers has done such damned thing, everyone can do this. Some ideas are to change keys for skipping, always wait 3 sec - time for cancel - and then save or skip, always saved changes - 3 sec time for sure only if you exit by executing shutdown without changes, launchers (see my above link) but guest should have on/off folder that content should decide about shutdown script way - if there is on file then save if only off then skip else ask and wait 3 sec, additional alert (are you sure?) if you have more than 50 MB in changes or session is longer than 2 hours, etc...
You have mind and feelings. Be wise and clever.

Post Reply