APMD-List:
Archives

  
Back

to

APMD

Home

      Index: [thread] [date] [subject] [author]
  From: Avery Pennarun <apenwarr@worldvisions.ca>
  To  : Jamie Zawinski <jwz@jwz.org>
<apmd-list@worldvisions.ca> Date: Thu, 20 May 1999 20:22:20 -0400

Re: pre-suspend notifications?

On Wed, May 19, 1999 at 08:44:17PM -0700, Jamie Zawinski wrote:

> Is there any way for a user-level program to be notified that the
> machine is *about* to be suspended, *before* the suspend actually
> happens? 

Sure, make sure you're running the 'apmd' program (3.0beta2 or newer) and
use the '-s' argument.  Hmm, it seems the man page doesn't document that. 
Oops.

Anyway, -s and -r are programs to run when entering/leaving suspend mode. 
-S and -R are programs to run when entering/leaving standby mode.  There are
commands to run when switching to battery/wallpower starting with beta6, but
it's broken so don't try :)

In Debian, we run a program to map pre-suspend/post-resume commands to the
set of scripts in /etc/apm/suspend.d and /etc/apm/resume.d, respectively. 
On Debian, at least, xscreensaver could install some scripts in there that
notify it (kill -HUP $(cat /var/run/xscreensaver.pid) or some such thing).

> Second question: is there any way to make apmd run "shutdown"
> automatically when the battery gets critically low?  Or perhaps, 
> force suspension or hibernation?  

I don't think so, at the moment.  That would be good, and pretty easy to add
to apmd.

Someone is working on some pretty major changes to the "event handling"
stuff in apmd for 3.0beta7.  It should be able to handle your low-battery
event as well as unifying the others in a nice way.

Have fun,

Avery


Index: [thread] [date] [subject] [author]


Write to me! apenwarr@worldvisions.ca