On Mon, 2003-08-11 at 15:59, Marshal Wong wrote: 
> 
> So what I gather needs to be done is to force uninstall the modules on
> sleep.  ALSA does support an option for this, but it only works with
> APMD, which is of no use to PMUD.  I tried hacking the PMUD scripts
> but obiviously, my shell-scripting sucks, otherwise, I would have been
> able to give a fix.

FWIW, here's how I call the APM scripts from /etc/power/pwrctl-local.
Seems to be working fine, but I don't use ALSA, so YMMV:

function pwrctl_Core99() 
{
        case "$1" in

[...]

        sleep)
                if [ -d /etc/apm/suspend.d ]; then
                        run-parts --arg="suspend" --arg="resume" 
/etc/apm/suspend.d
                fi
                if [ -d /etc/apm/event.d ]; then
                        run-parts --arg="suspend" --arg="resume" 
/etc/apm/event.d
                fi

[...]

        ;;
        wakeup)

[...]

                if [ -d /etc/apm/resume.d ]; then
                        run-parts --arg="resume" --arg="suspend" 
/etc/apm/resume.d
                fi
                if [ -d /etc/apm/event.d ]; then
                        run-parts --arg="resume" --arg="suspend" 
/etc/apm/event.d
                fi
        ;;

[...]

        esac

        case "$2" in
        ac)

[...]

                if [ -d /etc/apm/other.d ]; then
                        run-parts --arg="change" --arg="power" /etc/apm/other.d
                fi
                if [ -d /etc/apm/event.d ]; then
                        run-parts --arg="change" --arg="power" /etc/apm/event.d
                fi
        ;;
        *)

[...]

                if [ -d /etc/apm/other.d ]; then
                        run-parts --arg="change" --arg="save" /etc/apm/other.d
                fi
                if [ -d /etc/apm/event.d ]; then
                        run-parts --arg="change" --arg="save" /etc/apm/event.d
                fi
        ;;
        esac
}


-- 
Earthling Michel Dänzer   \  Debian (powerpc), XFree86 and DRI developer
Software libre enthusiast  \     http://svcs.affero.net/rm.php?r=daenzer

Reply via email to