[systemd-devel] Wishlist: HandleLidSwitchDocked ... when powered?

Mantas Mikulėnas grawity at gmail.com
Thu Jul 14 07:28:05 UTC 2016


On Thu, Jul 14, 2016 at 5:47 AM, Kai Hendry <hendry at webconverger.com> wrote:

> Hi there,
>
> I want my T460s machine to suspend on lid close only when it's not
> charging off mains.
>
> I've looked over
> https://www.freedesktop.org/software/systemd/man/logind.conf.html &
> https://wiki.archlinux.org/index.php/Power_management and I don't see
> how this can be achieved.
>

I usually deal with this by running `systemd-inhibit
--what=handle-lid-switch <cmd>` to prevent the auto-suspend. If you want an
automatic method, here's some scripting around UPower or udev:
https://github.com/grawity/hacks/blob/master/desktop/upower-ac-hold or
https://github.com/grawity/hacks/blob/master/system/ac-wait.c

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160714/3ad7557a/attachment.html>


More information about the systemd-devel mailing list