this post was submitted on 08 Mar 2024
51 points (94.7% liked)

Linux

45513 readers
1190 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] 8 points 3 months ago* (last edited 3 months ago) (3 children)

When connected to the outlet it will be running solely on outlet power just by default, you don't need to do anything specific.

Edit: Now that I re-read this OP, it sounds more like you want to stop the battery from charging when connected to AC.

[–] SchmidtGenetics 12 points 3 months ago (1 children)

That’s… not true.

It will still run through the converters and boards inside the laptop since it runs on DC and the power from the outlet is AC. Depending on how it’s setup, the current very well could go through the battery instead of bypassing it before it reaches the laptop from the converters.

Basically you don’t know unless you try. Some laptops work when you remove the battery and some don’t. Just like phones or any other electronic.

[–] [email protected] 1 points 3 months ago (2 children)

Current can't go through a battery, only in or out.

When connected to AC it will be running off AC, and also charging the battery.

[–] [email protected] 3 points 3 months ago (1 children)

That's not entirely true. A battery can definitely be part of a running circuit and current definitely goes through it, otherwise it wouldn't be usable.

[–] [email protected] 0 points 3 months ago (1 children)

It can be part of a circuit, but charge either goes in or comes out, it can't do both at the same time.

[–] [email protected] 2 points 3 months ago

I'm sorry but you're mixing concepts. Electrical charge: measured in Coulombs, physicaly either electrons or gaps. Current: movement of electrical charge. Battery charge: chemical capacity to generate a voltage differential. Voltage differential: the potential energy difference that pushes charges through a circuit.

Electrical charges need to move through a battery for it to do useful work. If the battery is causing the movement (current), it is depleting its chemical charge. If the battery is not pushing the electrons, it's likely being chemically charged (the complexities of which are beyond a lemmy comment). In both cases, the battery is part of the circuit that is conducting electrical charge. If there are no parallel paths and you remove the battery, the circuit ceases to exist and so does the current.

[–] [email protected] 7 points 3 months ago (2 children)

It's also going to charge the battery.

[–] [email protected] 7 points 3 months ago* (last edited 3 months ago) (1 children)

Some laptops allow for controlling level kf charge. For example I keep my battery at 65% to prolong its life. If its supported, you should be able to set it through /sys/class/power_supply/bat0/charge_level

~~i dont rember file name and path exactly but shouldnlook like this~~

Edit: Correct filename is /sys/class/power_supply/BAT0/charge_control_end_threshold

[–] [email protected] 3 points 3 months ago (1 children)

I do the same. My laptop had a weird bug where it would reset that value to 100 every reboot, so I made a systemd service to write it at every boot.

[–] [email protected] 2 points 3 months ago (1 children)

my laptop does reset it every reboot.

If you are using KDE, you can just use KDE's battery manager to set it there.

otherwise, your solution is good too.

[–] [email protected] 1 points 3 months ago

Even in KDEs battery manager, I was having the same issue.

[–] [email protected] -1 points 3 months ago (3 children)

Correct, but the laptop will be running off AC.

[–] [email protected] 5 points 3 months ago

But the concern is about the battery, so that's kinda moot.

[–] [email protected] 3 points 3 months ago

Electronics cannot run on AC voltage. That giant power brick converts it to DC.

[–] [email protected] 5 points 3 months ago* (last edited 3 months ago) (1 children)

Uhhhh not really? If your battery is not charged, it's typically going to charge it up to 100% and keep it there, which is not ideal for longevity. Some devices come with a "kiosk mode" that will keep the battery at 50% or so.

[–] [email protected] 5 points 3 months ago

Framework laptops have it as a BIOS setting. I keep mine at 60%, and before a trip I bump it back to 100%.