I'm am running Puppy 4 on my HP Pavilion ZE-5700 series laptop.
I quickly noticed there was no real support for auto-suspend to RAM or disk or any type of hibernate. None that worked for me anyway.
Big distros support this very well on my portable,but they are sluggish and I moved to Puppy for speed and usability.
I did some research and there is very little info available. I noticed also that I did not need to suspend because Puppy is by design so quick to boot that it is faster from a cold boot than any disro I know resuming from sleep states.
But....I still needed Puppy to poweroff by itself when I went away.
I found a script and modified it for Puppy. It uses Puppy's own native shutdown script to properly halt the sysem.
You can modify it with your own time and add up to 2 applications that will prevent shutdown if they are found to be running. My own setup is 30 minutes of inactivity (based on mouse / touchpad use) and If mplayer or gxine are running the shutdown will not occur (In case I am watching a movie).
Save this to your "startup" folder as mouseup.sh and give it permision (chmod +rx). It will startup at boot by itself. I tested it and it works flawless.
Code: Select all
#!/bin/bash
# /root/startup/mouseup (2008-11-24)
# A script for testing user activity on their mouse
# and shutting down if given programs (2) are not running
# and there has been no mouse activity for declared period
# off time. Run as root
TIME=30m #set time between checks, "m" suffix for minutes
LOGFILE=/var/log/mouseup.log #this is where all activity will be logged
test -n "$TIME"
if [ $? -eq 1 ]; then
echo -e "\nYou have to declare how many minutes delay"
echo -e "between 1st and 2nd check for mouse activity.\n"
echo -e "Usage: mouseup [minutes]\n"
exit
fi
echo "`date` Starting mousup. Delay time set to $TIME." > $LOGFILE
# By using single ">" a new log is created. All others are ">>" adding new lines to existing logfile.
while true
do
MOUSE1=`cat /proc/interrupts | grep 12: | awk '{print $2}'`
echo "`date` MOUSE1 equals $MOUSE1" >> $LOGFILE
sleep $TIME
ps -A | grep "mplayer" > /dev/null 2>&1 #Replace with your own software
if [ $? -eq 0 ] ; then
PROGA_CHK=0
echo "`date` Mplayer is running" >> $LOGFILE
else
PROGA_CHK=1
echo "`date` Mplayer is not running." >> $LOGFILE
fi
ps -A | grep "gxine" > /dev/null 2>&1
if [ $? -eq 0 ] ; then
PROGB_CHK=0
echo "`date` Gxine is running" >> $LOGFILE
else
PROGB_CHK=1
echo "`date` Gxine is not running." >> $LOGFILE
fi
MOUSE2=`cat /proc/interrupts | grep 12: | awk '{print $2}'`
echo "`date` MOUSE2 equals $MOUSE2" >> $LOGFILE
if [ $MOUSE1 -eq $MOUSE2 -a $PROGA_CHK -eq 1 -a $PROGB_CHK -eq 1 ] ; then
echo "`date` shutdown -h now" >> $LOGFILE
echo "shutting down"
#/usr/X11R7/bin/restartwm ---for testing purposes---
/usr/X11R7/bin/wmpoweroff
exit
fi
done
#End of script
http://www.linuxquestions.org/questions ... wn-525935/