[systemd-devel] improve lid switch event handling

Thomas Blume Thomas.Blume at suse.com
Tue Jul 22 03:35:12 PDT 2014


The current inhibitors for going into suspend at lid closure are based on the
presence of a docking station, multiple or no displays and a fixed timeout
after the last suspend event.
I understand the goal to prevent an immediate suspend when the system is booted
with closed lid and other inhibitors are not yet present.

But, ignoring the lid close event for a certain time, might not give the
best user experience.
I wondering wheter we couldn't set the inhibitors in a more userfriendly way.

My approach is based on the assumption that a user only wants a suspend at lid
closure, if there was a lid open before.
If the lid was not opened before, we can IMHO savely assume that there is
another display connected or there is a docking station or the user just want
to boot without display for any reason.

If so, we could record a previous lid open event e.g. in a status file.
We could then inhibit the suspend if there was no previous lid open event or
  allow it without timeout, if there was one.

I'm attaching a little example patch to visualize my approach.
Any comment is appreciated.


Regards
Thomas Blume

-- 
SUSE LINUX Products GmbH GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstr. 5 / D-90409 Nürnberg / Phone: +49-911-740 53 - 0
GPG 2048R/2CD4D3E8 9A50 048F 1C73 59AA 4D2E  424E B3C6 3FD9 2CD4 D3E8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: save-lid-open-state_example.patch
Type: text/x-patch
Size: 3769 bytes
Desc: 
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140722/9c4ae4ab/attachment.bin>


More information about the systemd-devel mailing list