[solved] Shutdown (physical) button

Jean-Christophe jc.sid at free.fr
Sun Jun 22 13:03:55 CEST 2008


> So I have just to modify my /etc/acpi/powerbtn.sh to make him launch 
> xfsm-shutdown-helper (or another command, maybe) with the right user 
> (this script is launched as root when power button is pressed)
>
>   
Well, I found something working 
(http://wiki.eeeuser.com/ubuntu:eeexubuntu:customization).
Here is what I haded in /etc/acpi/powerbtn.sh, replacing /hostname/ and 
/user/ by my own:

if ps -Af |grep -q 'xfce4-session' ; then
    SESSION_MANAGER=local//hostname/:/tmp/.ICE-unix/`ls /tmp/.ICE-unix` 
su -c '/usr/bin/xfce4-session-logout --display=:0.0' /user/
    exit 0
fi

the eeexubuntu wiki uses 'sudo', but it wasn't working on my debian. su 
just works.
the if condition tries to detect if xfce4-session is running, so 
xfce4-session-logout won't be launched if I'm not in a session




More information about the Xfce mailing list