You are not logged in.
My laptop was running on battery, and I realized it but forgot to plug it in.
When the battery reached 0%, it turned off. By turned off I mean it was playing sound, and the next microsecond everything was blank. Like it was abruptly disconnected from power.
This is no good to save work before turning off.
So I would like to implement a system that calls `shutdown` when the battery is 2% or lower.
What is the best way to do that?
Last edited by hully (2023-01-21 09:19:09)
Offline
Offline
Yes I found what I needed here: https://wiki.archlinux.org/title/Laptop … tery_level
Offline
Would a notification not be more useful? That way you would have time to save your work.
Offline
Would a notification not be more useful? That way you would have time to save your work.
I will add the notification. That seems a good idea.
But I will keep the shutdown. What if the laptop is e.g. in a backpack ? Or simply I'm not in front of it?
Offline
Go to S3/S4 early enough™ (S3 will still use battery, but slowly. S4 won't, once it's reached)
Offline
Go to S3/S4 early enough™ (S3 will still use battery, but slowly. S4 won't, once it's reached)
I did not understand.
What does it mean to go to S3 and S4? When I should go to S3 or S4?
Anyway it seems to work.
The "problem" is that my laptop doesn't seem to boot if the battery level is below a certain threshold.
Is that possible? How can I find this threshold?
Offline
What does it mean to go to S3 and S4? When I should go to S3 or S4?
https://en.wikipedia.org/wiki/ACPI#Power_states
"suspend to ram", "suspend to disk" and, as mentioned, "early enough"
For S3 this depends on the capacity of your battery and the power drain of the S3 state and teh frequency at which you expect to be able to deal with the situation.
Is that possible? How can I find this threshold?
Yes and vendor manual, but it's not a problem: you need to plug the AC no matter what.
Even if your hibernate the system right above that threshold, do you intend to then wake it on the same critical battery level?
Offline
I see. I implemented it. Thank you very much!
Offline