[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pbbuttonsd script interface - future?



Hi Matthias,
On Mon, Apr 19, 2004 at 02:01:33PM +0200, Matthias Grimm wrote:
> How must a interface to this scripts looks like to fullfill all needs?
Please have a look at the apmd_proxy script in the apm package. I'm
currently using something like this in my /etc/power/pwctl-local (most
of this was borrowed from something Michel posted a while ago IIRC).
e.g:

case "$2" in
  battery)
        if [ -x /etc/apm/apmd_proxy ]; then
                /etc/apm/apmd_proxy change power
        else
                run-parts --arg=change --arg=power /etc/apm/event.d
                if [ -d /etc/apm/other.d ]; then
                        run-parts --arg=change --arg=power /etc/apm/other.d
                fi
        fi
	....
  ac)
        if [ -x /etc/apm/apmd_proxy ]; then
                /etc/apm/apmd_proxy change power
        else
                run-parts --arg=change --arg=power /etc/apm/event.d
                if [ -d /etc/apm/other.d ]; then
                        run-parts --arg=change --arg=power /etc/apm/other.d
                fi
        fi
esac
...
case "$1" in
  sleep)
        # invoke apm scripts
        echo "Invoking apm scripts"
        if [ -x /etc/apm/apmd_proxy ]; then
                /etc/apm/apmd_proxy suspend user
        else
                run-parts --arg=suspend --arg=user /etc/apm/event.d
                if [ -d /etc/apm/suspend.d ]; then
                        run-parts --arg=suspend --arg=user /etc/apm/suspend.d
                fi
        fi
... (something similar for wakeup. I'm still using pbbuttonsd+pmud since
I never figured out if pbuttonsd can also do things like this already).
Debian packages put their scripts under /etc/apm at the moment. Not the
best choice, /etc/power would be better, a move over would need
coordination of the apmd and acpid maintainers I guess. 
A mechanism of a generic script (that basically does the above) + the
ability to add local changes (like pmud's pwrctl-local, maybe with
compatible calling conventions) would be everything that's needed IMHO).
Cheers,
 -- Guido

Attachment: signature.asc
Description: Digital signature


Reply to: