Suspend instead of power-off after X minutes *SOLVED*
Suspend instead of power-off after X minutes *SOLVED*
In the Puppy Event Manager, under the "Power" tab, you can set Puppy to power-off your computer after X minutes of no mouse activity.
I'd like to know how you can do the same thing but with Puppy suspending your computer after X minutes, instead of powering it off.
Thanks for any help.
I'd like to know how you can do the same thing but with Puppy suspending your computer after X minutes, instead of powering it off.
Thanks for any help.
Last edited by liro on Fri 12 Dec 2014, 20:24, edited 1 time in total.
Code: Select all
hdparm -S 120 /dev/sda
Hi nic, thanks for the reply. It looks like that script would enable energy saving spindown on my hard-drive after X minutes, but ideally I'd like to trigger the "suspend.sh" script in my etc/acpi/actions folder, as this would also switch off the backlight on my laptop's LCD. Is there any way I can make that script run automatically after X minutes of mouse inactivity?
does dpms turn of the backlight as well as the screen as that could be set to whatever you like too. I use that plus hdparm for me laptop/netbook.
Check out the xset help... puppy tends to only use the screen blanking by default. Its done in /root/.xinitrc
Ok its not true suspend but does the job of battery saving.
mike
Check out the xset help... puppy tends to only use the screen blanking by default. Its done in /root/.xinitrc
Ok its not true suspend but does the job of battery saving.
mike
If the built-in "Power off after X minutes" feature is expendable for you and you just want to replace it with 'Suspend', I suppose it's just a matter of editing the following line in /usr/local/pup_event/frontend_timeout (or /sbin/pup_event_frontend_d in older Pups):
However, personally I don't like the technique used in that script, because it relies on mouse movements only, so if one's using a keyboard exclusively for a longer period of time, it won't stop the script from triggering shutdown/suspend action.
IMO, a better way would be to use xprintidle (you can obtain compiled, 32bit version from here) along with a simple script like this:
(just make sure to put xprintidle somewhere in $PATH, e.g. /usr/local/bin/)
Greetings!
Code: Select all
[ $MOUSECNT -gt $POWERTIMEOUT ] && wmpoweroff &
IMO, a better way would be to use xprintidle (you can obtain compiled, 32bit version from here) along with a simple script like this:
Code: Select all
#!/bin/sh
TIMEOUT=1 # in minutes
TIMEOUT=$((TIMEOUT*60000))
while :; do
sleep 5
if [ `xprintidle` -ge $TIMEOUT ]; then
/etc/acpi/actions/suspend.sh
fi
done
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
[b][color=green]Omnia mea mecum porto.[/color][/b]
For the screen I add the following line to /etc/X11/xorg.conf in the ServerLayout section - Option "Offtime" "5" which will turn the screen off after 5 minutes of inactivity. Instead of "OffTime" you can also use "StandbyTime" or "SuspendTime"liro wrote:Hi nic, thanks for the reply. It looks like that script would enable energy saving spindown on my hard-drive after X minutes, but ideally I'd like to trigger the "suspend.sh" script in my etc/acpi/actions folder, as this would also switch off the backlight on my laptop's LCD. Is there any way I can make that script run automatically after X minutes of mouse inactivity?
Thanks everyone for the replies.
When I first started using Puppy (Slacko) I had a lot of problems getting suspend/sleep to work properly when closing the lid on my laptop (with it "waking up" after suspension and with the LCD backlight), so would prefer to stick with my modified "suspend.sh" which I know fully works.
As such, it looks like SFR's suggestion would be most suitable for me, but a couple of (probably dumb) questions:
1. After putting xprintidle in /usr/local/bin/, where do I put the script that triggers it (in the startup folder?)
2. Is the "sleep 5" bit in that script the number of minutes?
Thanks again.
When I first started using Puppy (Slacko) I had a lot of problems getting suspend/sleep to work properly when closing the lid on my laptop (with it "waking up" after suspension and with the LCD backlight), so would prefer to stick with my modified "suspend.sh" which I know fully works.
As such, it looks like SFR's suggestion would be most suitable for me, but a couple of (probably dumb) questions:
1. After putting xprintidle in /usr/local/bin/, where do I put the script that triggers it (in the startup folder?)
2. Is the "sleep 5" bit in that script the number of minutes?
Thanks again.
Last edited by liro on Thu 11 Dec 2014, 05:16, edited 1 time in total.
sleep 5 is the ACPI suspend state used... http://en.wikipedia.org/wiki/Advanced_C ... wer_states Will tell you more about them.
[url=http://totalelectronics.us]TotalElectronics.us[/url]
- rg66
- Posts: 1158
- Joined: Mon 23 Jul 2012, 05:53
- Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!
Code: Select all
#!/bin/sh
TIMEOUT=1 # in minutes
TIMEOUT=$((TIMEOUT*60000))
while :; do
sleep 5
if [ `xprintidle` -ge $TIMEOUT ]; then
/etc/acpi/actions/suspend.sh
fi
done
You can put the script in /root/Startup to run it at every boot, make sure it's executable (chmod +x /path/scriptname).
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]
[url=http://smokey01.com/rg66/]X-series repo[/url]
is this really in puppys now...thanks for the laugh this morning more junk in there than ever then..../usr/local/pup_event/frontend_timeout (or /sbin/pup_event_frontend_d in older Pups):
The code is so good you have to devise a workaround for it!!
oh well ..... I prefer using X...works as its supposed to...and yes too many reports of problems using true suspend functionality.
Mike