shutdown (physical) button
David Mohr
damailings at mcbf.net
Mon Jun 16 01:43:04 CEST 2008
On Sun, Jun 15, 2008 at 5:05 PM, Jean-Christophe <jc.sid at free.fr> wrote:
>
>> I succeed making the panel power button working, but I have another problem:
>> When I press my laptop power button, that powers off the computer, with
>> no popup, and not saving the session.
>> 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)
>> Any idea about what could be this command?
>>
> Ok I found this:
> if ps -A | grep xfce4-session ; then
> /usr/bin/xfce4-session-logout
> exit 0
> fi
>
> which I put in powerbtn.sh, but it (xf4-session-logout) has to be
> launched as my user, not as root. How could I?
> Regards again
> Jean-christophe
It might not be that easy, but you could try running "
su -c /usr/bin/xfce4-session-logout $user
where $user is your usual username
Note that this only works if you are the only user on the laptop,
otherwise you would need to parse the output of ps to find what user
is running xfce4-session.
~David
More information about the Xfce
mailing list