The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to write shell script to take back up amitpansuria Shell Programming and Scripting 5 06-01-2008 06:42 AM
Laptop/Desktop... Back up/Mirror script. komputersman Shell Programming and Scripting 5 03-19-2008 10:31 PM
Perl script to scan back lines gholdbhurg Shell Programming and Scripting 3 03-18-2008 09:33 AM
Calling subscript but sleep halts the main script doublejz Shell Programming and Scripting 1 09-12-2005 11:08 AM
Waking up windowsXP from FC3 dangral Windows & DOS: Issues & Discussions 1 08-26-2005 02:05 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-29-2008
dotancohen's Avatar
Registered User
 

Join Date: Feb 2008
Location: חיפה
Posts: 21
Laptop waking up in bag: go back to sleep script

I have a Debian-derived distro (Kubuntu 8.04) running on a Dell Inspiron laptop. This laptop often wakes from RAM suspension while in my bag. I would like to run a script, upon RAM suspension wake, that would detect if the lid switch is closed. If so, then the script should put the machine back in RAM suspension. Something like this:
Code:
wait 5 seconds
if (lid==open) {
  go to ram suspension
}
return
I do not know how to poll the lid switch, nor do I know how to suspend to RAM from within a script. I have googled but cannot find this. Can someone point me to a RTFM where TFM shows how to do these two actions? Note that other than a short C course in university and a smithering of PHP I really know nothing about computers. I will ask on my distro's mailing list how to have the script run at wake. Thanks in advance.
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0