this post was submitted on 08 Mar 2024
56 points (95.2% liked)
Linux
48190 readers
994 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
For devices where the kernel directly supports controlling the charging limits, you may be able to do that with the controls in
/sys/class/power_supply/{probably BAT0}/
. Specifically you should be looking for thecharge_start_threshold
andcharge_stop_threshold
files, but I remember as if sometimes there would be some variance in the names.If you have kernel support, you should be able to use TLP to make better use of this functionality, and in theory KDE's xbattery and brightness" widget should also show controls related to it, but I couldn't see it in action myself.
For devices that use the EC (Embedded Controller) of chromebooks (I think such are the Framework laptops too) you can use the
ectool
command utility made for those. Framework makes available a precompiled version, that should work for chromebooks too when running Linux.Possibly it still depends on your specific device whether it will work, but the
ectool chargecontrol idle
command should make it stop using the battery while it is plugged in to a sufficiently powerful charger, andectool chargecontrol normal
should be able to restore it.I recommend checking out the other commands of both the ectool command and the chargecontrol subcommand if you see anything interesting (though do be cautios!), for instance with chargecontrol you can also set an interval of a charging boundaries, or read the current state.
It's worth to note though that I remember reading somewhere (maybe in the chrome ec docs?) that this does not work with all chargers, but it should be ok with the original one you got with the device.