Battery Limiter on KDE

Hello
I need to limit battery charge to 40-80% and get notifications on each state
I have tried tlp, battery-monitor and some scripts.
tlp doesn’t work for me, battery-monitor is buggy and in case of scripts I think I couldn’t configure correctly and couldn’t fully understand how to get the results
I hope someone can help me here and give exact instructions

This feature will be available with 5.20:


which is scheduled for 2020-10-13: Schedules/Plasma 5 - KDE Community Wiki
3 Likes

It’s great thanks a lot for amazing news I won’t have to break anything in my system :smiley: :smiley: :smiley:

That’s fantastic. My machine is usually plugged in so this will help preserve the battery. Thanks for the info…

Check the BIOS setting if you have the option as well,some laptops has the option to set the limit and the % to charge up the battery.

Please everyone: don’t get overexcited:

Most hardware is Defective by design because the manufacturer wants to sell more batteries. This is how you can test your support today:

sudo tlp-stat --battery

--- TLP 1.3.1 --------------------------------------------

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi    = inactive (laptop not supported)
tpacpi-bat = inactive (laptop not supported)
tp-smapi   = inactive (laptop not supported)

[...]
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
[...]

So I already know my Acer laptop is not supported and one of the reasons I’ll never buy one again…

:man_shrugging:

2 Likes

If you have a Latop which supports lenovo vantage you could try this
https://wiki.archlinux.org/index.php/Lenovo_IdeaPad_5_15are05#Battery_Conservation

It seems my laptop HP Probook 450 G6 is not supported as well so back to first option
How can I limit battery charge to 80% and get notification or just get notification when battery level is 80%? Anyone can help?

Sorry for being confusing in my previous post: There is nothing out there for your Probook 450 G6 and HP refuses to do anything about it because that’s how they sell more batteries (and what I meant with Defective by design)

But you’re always free to create a script ¹ that runs once every 5 minutes and prints a message that your battery level is >80%, but then it’ll print it every 5 minutes:man_shrugging:

E.G. something like ²:

#!/bin/bash
MyBatteryCharge=`sudo tlp-stat --battery | grep Charge | grep = | awk '{print $3}'`
if (( $(echo "$MyBatteryCharge > 80" |bc -l) )); then
  notify-send "Battery" "Hey, this is your battery talking: I'm charged above the 80% threshold"
fi

and then cron that every 5 minutes.

But the answer to:

is:

you cannot.

:sob:

Note 1: That’s the advantage of FLOSS: You can always do yourself what others don’t provide for you…
Note 2: I’ve just created this script off the cuff and haven’t actually tested it, it’s just an example.

I have been eagerly awaiting this feature!