Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work on Linux? #41

Open
ericksuzart opened this issue Aug 26, 2022 · 2 comments
Open

Does it work on Linux? #41

ericksuzart opened this issue Aug 26, 2022 · 2 comments

Comments

@ericksuzart
Copy link

Hi guys, I have an old MacBook Pro 7.1 running Ubuntu and I care to my battery lifespan. This project works on Linux? Do you guys know some that works?

@Atemu
Copy link

Atemu commented Jan 3, 2023

The underlying CLI program uses Apple's SMCKit library/framework, so no that won't work on Linux I believe.

A Linux kernel driver for the SMC is required for this sort of thing to work, so I'd start looking into that.

@porteusconf
Copy link

tl/dr: Good question! It might be worthwhile to try a temporarily boot to 10.14, like from external usb, and run Charge Limiter in 10.14. Then, If lucky, when booted back to linux the battery may not charge above the limit set in 10.14. I say this because it works for me when booting 10.13, where charge-limiter cannot be run, as detailed below.

... Details of my possibly flawed reasoning.... Since the limit is stored in nvram (not anywhere on disk storage), I think when linux is running, perhaps the charge limit might still be in effect. I have not tested in linux(yet) but if I have time will test in linux and update this posting with results. The reason I thiink it is worth a try is based on what I see with a dual-boot mac laptop: 10.13 or 10.14. I set the limit to 80% in 10.14, and when I boot to 10.13, the battery does not charge above 80% or so. The charge-limiter 1.5.1 currently does not run on 10.13 or earlier (tho I tried, below). In 10.13 when launched, after about a second it displays error below about bclm (bclm is the The underlying CLI program uses Apple's SMCKit library/framework,

$  ./bclm --help
dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Applications/Charge Limiter.app/Contents/Resources/./bclm
  Reason: image not found
Abort trap: 6
$ file bclm 
bclm: Mach-O 64-bit executable x86_64
$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G6030
$ ls -l /Applications/Charge\ Limiter.app/Contents/Resources/bclm 
 1382576 Nov 19  2020 /Applications/Charge Limiter.app/Contents/Resources/bclm

P.S. My first try to compile bcim that might run on 10.13 failed as shown below... (I have the command-line tools but maybe I need full xcode???)

bash-3.2$ pwd
/Users/Shared/bclm/bclm
bash-3.2$ swift build
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

bash-3.2$  xcode-select -p   
/Library/Developer/CommandLineTools

bash-3.2$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G6030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants