Page 1 of 3

Enable suspend on lid close?

Posted: 10 Jan 2014, 03:45
by kentchristopher
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.

Re: Enable suspend on lid close?

Posted: 10 Jan 2014, 04:57
by francois
In the kde desktop:
kde panel > applications > settings > kde settings > energy saving > button event handling > sleep

Re: Enable suspend on lid close?

Posted: 10 Jan 2014, 05:10
by kentchristopher
Is it also possible in LXDE? (Sorry, should have specified that.)

Re: Enable suspend on lid close?

Posted: 10 Jan 2014, 08:45
by fanthom
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.

Re: Enable suspend on lid close?

Posted: 10 Jan 2014, 16:26
by Ed_P
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?

Re: Enable suspend on lid close?

Posted: 10 Jan 2014, 17:38
by francois
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

Re: Enable suspend on lid close?

Posted: 10 Jan 2014, 18:27
by Ed_P
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.

Re: Enable suspend on lid close?

Posted: 11 Jan 2014, 05:01
by Ed_P
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.

Re: Enable suspend on lid close?

Posted: 11 Jan 2014, 09:45
by fanthom
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

Re: Enable suspend on lid close?

Posted: 11 Jan 2014, 16:00
by francois
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)

Re: Enable suspend on lid close?

Posted: 12 Jan 2014, 03:03
by francois
... that performs automatically a shutdown of the os under porteus. ... it should save your current desktop data. :D

Re: Enable suspend on lid close?

Posted: 12 Jan 2014, 04:42
by Ed_P
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.

Re: Enable suspend on lid close?

Posted: 12 Jan 2014, 13:16
by brokenman
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!

Re: Enable suspend on lid close?

Posted: 12 Jan 2014, 20:47
by Ed_P
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

Re: Enable suspend on lid close?

Posted: 12 Jan 2014, 21:31
by tome
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...