Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 3159  / 3 Years ago, sat, november 6, 2021, 6:18:24

I know, when the battery is flat, the computer dies. That's not the question. My question revolves around the fact that the battery meter in my computer gives inaccurate readings. The battery in my laptop lasts about 3 hours, give or take. But using my computer on battery will leave me about 25 minutes of usage. I have found an option in KDE that lets me disable automatic sleep and screen locking, although this only helps when the computer is connected to AC, then enabled, then disconnected, which really defeats the purpose in my mind.


The annoyance comes from Windows not having a problem with my battery at all. Ubuntu will run out of juice and not boot at all, but when booting to windows I get the whole list of battery warnings and indicators, but I can still use the OS until the battery truly dies. Even after Ubuntu runs out.


So I'm guessing (in true Linux spirit) there's a config file somewhere that keeps the OS from shutting down when it thinks the battery is at 0%. I just can't find it.


I've tried time and time again to reset or calibrate the meter, but that hasn't worked. I've even replaced the battery entirely.


Any pointers would be much appreciated.


More From » suspend

 Answers
4

If you don't mind living on the wild side, you can tell Ubuntu to ignore everything and soldier on until the battery literally cannot supply enough juice to keep the lights on. This may have unintended consequences, such as data loss, though. That said, here are two options that you have available:


Option 1 — Lower Your Percentages


You can lower the percentages for when Ubuntu takes an action. The easiest way to do this would be with dconf-editor, as it's visual and saves you from a bunch of copy/paste into a Terminal ... so long as you have the application installed.


If you don't:


sudo apt update
sudo apt install dconf-editor

Then ...



  1. Open dconf-editor:
    Find dconf-editor

  2. Press Ctrl+F (or click the magnifying glass) to bring up the search option, then type "power". You are looking for:
    /org/gnome/settings-daemon/plugins/power


  3. This will give you lots of options to control how Ubuntu responds to various power statuses:
    plugins-power

  4. Find percentage-critical and click the row

  5. Toggle the "default value" off and set the "custom value" to any number between the minimum and maximum range ... though the daemon will only respond to values between 0 and 100:
    percentage-critical

  6. Save the change and go up a level

  7. Find "Use Time for Policy", which will be at the very bottom and toggle the option off:
    Use Time for Policy

  8. Save your changes. This will ensure that — in the event the time remaining value is triggered before the percentage — that the system will not prematurely respond to a low battery


For most situations, this should be enough. However, if your battery "lies" about how much power it has remaining, then there's an additional step you can do.



Warning: Doing this can result in data corruption if a write is interrupted by a complete loss of power. I offer no warranty, implied or otherwise, on this action.



Option 2 — Tell the Machine to Stay Awake



  1. Still in dconf-editor, find "critical battery action"

  2. Toggle the default off

  3. Choose your poison:
    Critical Battery Action
    If you choose nothing, the machine will stay on until the battery is unable to provide enough voltage to the system. This will result in a very ungraceful shutdown.


Hopefully one (or both) of these options will give you some additional runtime.


[#1539] Monday, November 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
edseager

Total Points: 185
Total Questions: 105
Total Answers: 102

Location: Angola
Member since Wed, Apr 13, 2022
2 Years ago
;