While it is not super clear to me what stops sleep state being supportable, I was wondering can’t we mimic such a state somehow?
Let’s say, could we half certain processes and/or lower the CPU clock speed so the energy usage and heat generation would also lower significantly?
I’d love to close the laptop around 50% battery and leave it in a low-power state on the bedside table and not wake up to the battery being discharged completely.
I am just thinking aloud, but I’d also appreciate to know what do you all think.
I have been working on this with good success as part of the distro i have been working on. I have it go into a ultra low power state by detecting the lid close and lid open events and disabling the screen, lowering cpu power plan, disable wifi, bluetooth and a few other things.
so you can just shut your lid and the battery will last like 17-18 hours, so you can totally do what you want, shut it, put it on your bedside, pick it up again a couple hours later, still have lots of power. it works really well and the version i have posted is very stable.
Also i have a working battery icon and I rewrote the battery polling mech from what was provide by argon in rust. so the polling is much less expensive, about 100X because their tool was using python. clicking the icon you can manually change power plan, and power plan auto change and monitor dimming /un dimming when you plug and unplug from power.you can pull what you need from my repo, or if you just wants something that works and works really well check out the current release of my distro. only takes like 20 minutes to install / setup.
i am playing with a custom kernel rn to see if I can do better, and not yet.
Thanks for sharing! Your experience in trying to get close to the sleep-like state are interesting.
Alternatively, you can fine .DTB files that map the GPIO to a “LID” input event and then you can use the regular input/LID features of your distro to handle the lid instead of a custom script watching the GPIO pin.
There are two drivers in the forum (I use this one; there is also that one) that work as regular Linux battery drivers and allow you to use the regular battery features of your distro (e.g.: the built-in status icon) instead of a custom script (or in your case: rust binary) polling the battery’s I2C.
That has a few bugs that I had patched, for example when battery reaches 100% it will still report charging. I had reviewed that after seeing it to see if it would be good to include in my distro but decided to keep my implementation as it was more polished.