[TuxOnIce-users] hibernate scriptlets

Matt Price moptop99 at gmail.com
Mon Apr 5 15:40:08 UTC 2010


Hi,
I;m dealignwith a bug in my mailer (wanderlust, which runs inside
emacs); it seems to cause emacs to hang on resume, which is a drag as
I have most of my life in my emacs instance.  I want to send a command
to emacs on suspend that 'unplugs' the mailer -- like this:

emacsclient --socket-name /tmp/emacs1000/server --eval
"(wl-toggle-plugged 'off)"

and then send a corresponding command on resume. Is this an
appropriate use of the hibernate scriptlets?  And am I right in
thinking I should hve an /etc/hibernte/scriplets.d/wanderlust that
looks something like this:

---------------------------

AddConfigHandler WanderlustOptions

WanderlustSuspend() {
    /usr/bin/emacsclient --socket-name /tmp/emacs1000/server --eval
"(wl-toggle-plugged 'off)"
}

WanderlustResume() {
    /usr/bin/emacsclient --socket-name /tmp/emacs1000/server --eval
"(wl-toggle-plugged 'on)"
}

WanderlustOptions() {
    case $1 in
        *)
            return 1
    esac

    if [ -z "$WANDERLUST_HOOKED" ] ; then
        AddSuspendHook 01 WanderlustSuspend
        AddResumeHook 01 WanderlustResume
        WANDERLUST_HOOKED=1
    fi
    return 0
}

------------------------

thanks again,
matt


More information about the TuxOnIce-users mailing list