this post was submitted on 08 Mar 2024
56 points (95.2% liked)

Linux

47952 readers
2565 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

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

more questions about the MacBook Pro, Core i5, 2.8 GHz (I5-4308U), model A1502 (EMC 2875), a model where I cannot disconnect the battery, because the whole case is closed, a model Im going to use to experiment with mac and create a partition to install a linux distro alongside the mac os.

My favorite notebook is a one that lets me take the battery off if I don't need it. This way I've been able to need just one battery in the last 8 years. Regarding the mac, I'm going to need a new battery (it lasts 5 hours the most) and don't want to waste charging cycles.

My question is twofold:

  • Is there any linux program that lets me manage the battery so I can choose to rely solely on outlet power, even if I cannot physically remove the battery?

  • the same question for mac.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 9 points 7 months ago* (last edited 7 months ago)

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 the charge_start_threshold and charge_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, and ectool 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.