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

batt 0.2.1 (new formula) #166340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jerry1144
Copy link
Contributor

@Jerry1144 Jerry1144 commented Mar 16, 2024

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Add batt, a utility to manually control charging of Apple Silicon Macbooks, instead of hoping macOS limit charging to 80% for us. I tried to use brew services to handle installing the relevant launchd.plist, although the tool itself has a built-in routine to do so.

I wonder if, instead of hardcoding them, there's a more elegant way of fetching VERSION and GIT_COMMIT variables from the URL. Having Ruby variables holding these two means we don't forget about those in the test do block below.

I cannot decide whether to use system "plutil" or inreplace to modify the plist file, too. The former won't work on Linux, but it handles insertion better than the inflexible replacement syntax.

The uses_from_macos "curl" documents the peculiar fact that IPC is handled using http. Should I remove it instead?

@github-actions github-actions bot added go Go use is a significant feature of the PR or issue new formula PR adds a new formula to Homebrew/homebrew-core labels Mar 16, 2024
Formula/b/batt.rb Outdated Show resolved Hide resolved
Formula/b/batt.rb Outdated Show resolved Hide resolved
Formula/b/batt.rb Outdated Show resolved Hide resolved
Formula/b/batt.rb Outdated Show resolved Hide resolved
@Jerry1144 Jerry1144 force-pushed the batt-new-formula branch 2 times, most recently from cdce86f to e99fe6a Compare March 20, 2024 12:07
@Jerry1144
Copy link
Contributor Author

Jerry1144 commented Mar 20, 2024

I think that's about it, a Formula with a sane test. Sort of. No idea why the batt daemon test does not generate the config file that I can test for existence at a later stage. There's nothing in testpath, it can find the config if there's one leftover at HomebrewPrefix/etc, but it cannot write one anew or that it got deleted right after the first test exited.

TODO: learn more about launchd.plist to see whether the SocketPath key makes no sense in this case.

Formula/b/batt.rb Outdated Show resolved Hide resolved
@charlie0129
Copy link

The uses_from_macos "curl" documents the peculiar fact that IPC is handled using http. Should I remove it instead?

I think it can be removed because the ipc http client is contained in the binary itself.

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Apr 15, 2024
@Jerry1144
Copy link
Contributor Author

The failing test should have been resolved by Homebrew/brew#16914, a relatively new change. Now the tests should not be failing anymore.

@chenrui333
Copy link
Member

@Jerry1144 can you rebase your pr to the latest master and give it a rerun? Thanks!

Add [batt], a tool to manipulate charging limit on Apple Silicon Macbooks
in place of macOS's opaque Optimize Battry settings.

A service do block was also supplied to utilize brew services.

[batt]:https://github.com/charlie0129/batt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Go use is a significant feature of the PR or issue macos-only Formula depends on macOS new formula PR adds a new formula to Homebrew/homebrew-core stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants