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

Ben Boeckel mathstuf at gmail.com
Sat Oct 27 00:08:50 PDT 2012


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.

--Ben

(I'm not subscribed to the list)

Ben Boeckel (6):
  units: add target for locking all active sessions
  logind: add lock action for button triggers
  dbus: add a signal before locking the system
  logind: add inhibit support for a system-wide lock
  NEWS: add a note
  NEWS: fix a typo

 Makefile.am                                |  3 +++
 NEWS                                       |  7 +++++--
 man/logind.conf.xml                        |  5 +++--
 man/systemd.special.xml                    |  8 ++++++++
 src/login/logind-button.c                  |  9 ++++++---
 src/login/logind-button.h                  |  1 +
 src/login/logind-dbus.c                    | 13 +++++++++----
 src/login/logind-inhibit.c                 |  6 +++++-
 src/login/logind-inhibit.h                 |  3 ++-
 src/login/org.freedesktop.login1.policy.in | 10 ++++++++++
 units/.gitignore                           |  1 +
 units/lock.target                          | 14 ++++++++++++++
 units/systemd-lock.service.in              | 17 +++++++++++++++++
 13 files changed, 84 insertions(+), 13 deletions(-)
 create mode 100644 units/lock.target
 create mode 100644 units/systemd-lock.service.in

-- 
1.7.12.1



More information about the systemd-devel mailing list