[systemd-devel] [PATCH 0/6] Add 'lock' action for hardware buttons

Lennart Poettering lennart at poettering.net
Sun Oct 28 04:29:36 PDT 2012


On Sat, 27.10.12 03:08, Ben Boeckel (mathstuf at gmail.com) wrote:

> Hi,
> 
> I was surprised to find that my laptops were suspending when the lid was
> closed after updating to Fedora 18 since I find it a misfeature of power
> management defaults and it's one of the first things to go on new
> machines. I much prefer locking the session instead since I leave my
> machines doing work, but like to also have them be unobtrusive when on
> my desk.
> 
> This series of patches add a 'lock' target which runs `loginctl
> lock-sessions` and wires it up to a new option for the button. I also
> added inhibit logic, though this might make less sense at a system
> level. At the user level, it'd be perfect for media players and the
> like.
> 
> The code hasn't been tested beyond a build and making sure that the new
> files appear in the install. I have yet to write a simple Python DBus
> listener to trigger the locker that I use (xlockmore), so I don't
> (currently) have my setup available to test.
> 
> Feedback greatly appreciated.

So, there's something that confuses me a bit about this: a DE that
listens to the Lock requests of logind and puts up the screen lock
should also be capable of taking the key handling inhibitor lock which
will disable logind's own handling of the key. I mean, if you add logind
support to your DE you probably should do it fully and go all the way,
no?

I don't believe we need any special support for inhibiting locks
though. Inhibiting suspend/poweroff certainly makes a lot of sense,
since it breaks certain operations. But screen locking doesn't really
break much.

Anyway, I have now added a minimal patch that introduces "lock", as it
is really easy to do if we shortcut it internally. I hope this settles
this anyway, even though the precise use case is not clear to me...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list