Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power nap mode #501

Open
mazzz1y opened this issue Jun 12, 2020 · 6 comments
Open

Power nap mode #501

mazzz1y opened this issue Jun 12, 2020 · 6 comments

Comments

@mazzz1y
Copy link

mazzz1y commented Jun 12, 2020

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?

@linrunner
Copy link
Owner

linrunner commented Jun 14, 2020

Hi, interesting idea.

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

@mazzz1y
Copy link
Author

mazzz1y commented Jun 14, 2020

Hi @linrunner, thanks for response

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

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

@linrunner
Copy link
Owner

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

@mazzz1y
Copy link
Author

mazzz1y commented Jun 14, 2020

@linrunner no,

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

@linrunner
Copy link
Owner

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

@konradmb
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants