Skip to content

Get the battery usage of all your devices on your Mac and put them on the Dock / Menu Bar / Widget!

License

Notifications You must be signed in to change notification settings

Firebolt9907/AirBattery

This branch is 11 commits ahead of, 3 commits behind lihaoyun6/AirBattery:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e69c421 · · Aug 15, 2025

History

133 Commits
Aug 8, 2025
Aug 15, 2025
Mar 16, 2024
May 19, 2025
Oct 11, 2024
May 19, 2025
Aug 8, 2025
Feb 11, 2024
Aug 8, 2025
Jun 3, 2024
Aug 15, 2025
Jun 10, 2025
Aug 15, 2025
Aug 8, 2025

Repository files navigation

AirBattery

Get battery usage of all devices on Mac and show them on the Dock / StatusBar / Widgets!

DISCLAIMER: THIS IS NOT THE OFFICIAL REPO, THIS IS A FORK

Installation and Usage

System Requirements:

  • macOS 11.0 and Later
  • Android 4.0 and Later (Tasker requirement, but not tested on any version below the Android 16 QPR1 Beta 3 😐)
  • Tasker 4.2u3 (if you have it installed, you likely have a version higher than this)

Installation:

  1. Download the latest installation file here on your Mac
  2. Turn on Nearcast after installation
  3. Open tasker_airbattery_sender.js in a new tab, and copy the file contents into a text editor such as TextEdit
  4. Replace the 4 variables in the configuration section to match your mac as shown in comments
  5. Copy the file contents to your Android device (using Google Docs, KDE Connect Clipboard Sync, or a similar technology)
  6. Create a Tasker task and add an action for "JavaScriptlet"
  7. Paste the file contents into the code section
  8. Scroll down, disable "Auto Exit", and reduce the "Timeout" to something below 15 seconds to reduce battery impact
  9. Back out of the task, and create a profile
  10. Set trigger to Event -> Power -> Battery Changedhanged
  11. Set task to run as the task you created earlier

Usage:

Shared with original:

  • After AirBattery is started, it will be displayed on both the Dock and the status bar by default, or only one of them (can be configured)
  • AirBattery will automatically search for all devices supported by the "Nearbility Engine" without manual configuration.
  • Click the Dock icon / status bar icon, or add a widget to view the battery usage of your devices.
  • You can also use the "Nearcast" feature to check the battery usage of other Macs and their peripherals in the LAN at any time.
  • You can also change the status bar icon to a real-time battery icon in preferences, just like the one that comes with the system.
  • If necessary, you can hide certain devices in the Dock menu or status bar menu, and unhide them at any time.

Unique to this fork:

  • The Nearcast feature now extends to Android devices that run the Tasker script above in the LAN or over Tailscale

Demo of fork's usage:

Screen.Recording.2025-08-15.at.11.28.49.AM.mov

Q&Amp;A

1. Why does the original not have Android support?

The creator has mentioned that there is no Android support, and while they didn't state why, I found out the hard way. The project uses MultipeerKit, which is exclusive to Apple devices.

2. Why are you not requesting to merge this fork?

This fork has been vibe-coded into oblivion to create a local REST API server that runs a second instance of MultipeerKit for the Android device. While the HTTP server the app has is encrypted with the same private key as nearcast, it is still a janky solution, and I would rather the creator implement it themselves a more efficient way.

Donate to the original creator

This fork would not be possible without lihaoyun6

About

Get the battery usage of all your devices on your Mac and put them on the Dock / Menu Bar / Widget!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 94.4%
  • JavaScript 2.7%
  • C 1.3%
  • Other 1.6%