[systemd-devel] diverting HandlePowerKey

Robin Becker robin at reportlab.com
Thu Aug 16 08:27:50 PDT 2012


............
>
> I don't get this. This "oblogout" thing is a graphical tool you spawn
> from the system level? Does that mean it runs privileged but accesses
> your unprivileged X session? That sounds wrong...
>
> If you have a graphical session then the graphical session should handle
> the power/sleep key presses directly.

OK I'm a bit out of my depth here, I'm using the acpid mechanism because that's 
just an easy way to get access to those events. I can also run oblogout from a 
menu (ie from the DE). I didn't know that the power button etc etc are visible 
to X, but looking in the openbox configurator I can see XF86PowerOff, that 
allows me to run oblogout from the DE on the power button press. I think the 
original idea came from archbang or crunchbang some years back.

However, I'm a bit lost on what's the correct way for a user program to signal 
that it wants to shut down etc. Slim appears to be running polkit/consolekit so 
presumably I can use that, but is there a preferred systemd approach? Clearly 
just doing sudo halt etc etc is the wrong approach.
>
>> Is there a way to divert HandlePowerKey to a script of my choosing?
>
> No, there currently isn't. Eventually might add something that would
> allow people to reconfigure what happens when people press the
> power/sleep keys. But I am not sure we'll allow specification of
> arbitrary scripts for that.
>
> Lennart
>
sounds a bit strict, but perhaps I'm a bit of an anarchist. I definitely think 
you should allow control over whether suspend or hibernate or shutdown gets done 
for at least the lid button.
-- 
Robin Becker


More information about the systemd-devel mailing list