TLP icon indicating copy to clipboard operation
TLP copied to clipboard

Power nap mode

Open mazzz1y opened this issue 4 years ago • 6 comments

I'm return back from macOS to Linux laptop, and I have one feature which I missed. I want to implement mode that called on macOS as Power Nap.

Because power management on my laptop managed by TLP, I think that this app should have this feature. In general, TLP should have one more mode -- is lid opened/closed.

In my case, I want this scenario: When lid closed and AC is plugged, laptop should be in aggressive powersave mode, with minimal CPU frequency and disabled all of components as possible. In this mode it can do background tasks, like -- backup by network, Mail/IM notifications, updates, etc.

What do you think about this?

mazzz1y avatar Jun 12 '20 13:06 mazzz1y

Hi, interesting idea.

If you find out the udev event for closing or opening the lid, i will think about it.

linrunner avatar Jun 14 '20 11:06 linrunner

Hi @linrunner, thanks for response

I've researched a bit, this event managed by acpi:

~ cat /proc/acpi/button/lid/LID0/state
state:      open

mazzz1y avatar Jun 14 '20 15:06 mazzz1y

ACPI event is unfortunate because the whole /etc/acpi/event stuff is seriously deprecated imho. No udev event?

linrunner avatar Jun 14 '20 16:06 linrunner

@linrunner no,

systemd uses acpi for HandleLidSwitch, HandlePowerKey and other events like these, so I think that it's acceptable

mazzz1y avatar Jun 14 '20 17:06 mazzz1y

That is exactly where the problem lies: systemd (logind) consumes those events but doesn't expose an interface to hook them.

linrunner avatar Jun 14 '20 18:06 linrunner

There is a D-Bus property for lid in logind:

busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager LidClosed

konradmb avatar Jul 27 '20 12:07 konradmb