<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 14, 2016 at 5:47 AM, Kai Hendry <span dir="ltr"><<a href="mailto:hendry@webconverger.com" target="_blank">hendry@webconverger.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
I want my T460s machine to suspend on lid close only when it's not<br>
charging off mains.<br>
<br>
I've looked over<br>
<a href="https://www.freedesktop.org/software/systemd/man/logind.conf.html" rel="noreferrer" target="_blank">https://www.freedesktop.org/software/systemd/man/logind.conf.html</a> &<br>
<a href="https://wiki.archlinux.org/index.php/Power_management" rel="noreferrer" target="_blank">https://wiki.archlinux.org/index.php/Power_management</a> and I don't see<br>
how this can be achieved.<br></blockquote><div><br></div><div>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: <a href="https://github.com/grawity/hacks/blob/master/desktop/upower-ac-hold">https://github.com/grawity/hacks/blob/master/desktop/upower-ac-hold</a> or <a href="https://github.com/grawity/hacks/blob/master/system/ac-wait.c">https://github.com/grawity/hacks/blob/master/system/ac-wait.c</a></div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div></div>
</div></div>