shutdown (physical) button

Jean-Christophe jc.sid at
Mon Jun 16 20:29:35 CEST 2008

> su -c /usr/bin/xfce4-session-logout $user
works in a root console, but effectively not in

> That's not gonna work... for starters, you need DISPLAY set, which is
> easy, but you also need SESSION_MANAGER set, but that value changes
> with every new session.  You'd have to do something like run a script
> on startup that saves that env var to a file somewhere, and then your
> shutdown script would have to read that file and set the var.  An
> exercise left to the reader ^_^.
Too hard for me, but if someone could explain, I'll be happy to try?
>> Is this also possible using dbus? This would be much less complex IMHO.
> Not really.  You essentially have the same problem.  The dbus session 
> bus relies on env vars to tell applications how to contact it.
> Another solution to this problem might be to stop handling power button 
> presses using acpid (I thought acpid was deprecated, anyway, and events 
> like that should go through a /dev/input/event# device in the future). 
> Then you could catch the power key via some kind of power management 
> daemon that runs as a part of your X session, and do something 
> appropriate there.  But that's quite a bit of work...
Well, I'm in a Debian, and with my first installation I installed the 
debian 'desktop-base' with xfce, and there were the gnome-power-manager 
in. In this case my button was working. I just try now to have a nearly 
'no-gnome' desktop. Does a light power-manager exists?

And well, "dbus" sounds like chinese for me...

Thanks for your interest on it

More information about the Xfce mailing list