MCPcopy Index your code
hub / github.com/Code-Hex/battery

github.com/Code-Hex/battery @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
57 symbols 129 edges 9 files 18 documented · 32%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

battery - Draw battery unicode art written by Go

sc_battery
MIT License

battery unicode art on your tmux sessions or the terminal.

Status

(2022-07-29)
macOS build artifacts are cgo-less now!!
use goreleaser to release artifacts.

(2019-11-03)
Supported to display patched fonts.
Very Thanks TsutomuNakamura!!

Let's run battery -i after installed patched fonts. See more details.

(2018-05-01)
Supported to show elapsed time.
Very Thanks delphinus!!

Let's run battery -e

elapsed time

(2016-10-24)
linux supported.
Thanks mattn!!

(2016-10-21)
windows supported.

(2016-10-20)
Now, this command can use mac user only.
However, I hope to support ~~windows~~ and ~~linux~~, bsd in future.
So, plz help me (´;ω;`)

Installation

Mac and Linux users via Homebrew

$ brew update
$ brew install Code-Hex/tap/battery

Go

$ go install github.com/Code-Hex/battery/cmd/battery@latest

Binary

You can download from here

Usage

For tmux user, please write #(battery -t) in your .tmux.conf
Please refer to this

Support patched fonts

You can display the status of battery with patched fonts. Installing the font, Inconsolata Nerd Font Complete.otf for example, you can do it like below.

  • For mac
cd ~/Library/Fonts/
wget https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/Inconsolata/complete/Inconsolata%20Nerd%20Font%20Complete.otf
  • For Linux
cd ~/.local/share/fonts
wget https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/Inconsolata/complete/Inconsolata%20Nerd%20Font%20Complete.otf
  • For Windows
* Open your browser then fill this url
  https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/Inconsolata/complete/Inconsolata%20Nerd%20Font%20Complete.otf
* Double click the file that you downloaded and the window will be opened
* Click the install button

Your environment might require to reboot the OS. If so, reboot your OS. Then open your terminal and set your preferences to use it.

Then for tmux user, please write #(battery -t -i) in your .tmux.conf.

patched_font_100 patched_font_50 patched_font_10

Contributor 🎊

Author

codehex

Core symbols most depended-on inside this repo

syscall
called by 12
internal/macos/corefoundation.go
FuncPC
called by 12
internal/macos/abi.go
CFRelease
called by 5
internal/macos/corefoundation.go
CFDictionaryGetValueIfPresent
called by 3
internal/macos/corefoundation.go
StringToCFString
called by 3
internal/macos/corefoundation.go
write
called by 2
battery.go
Info
called by 2
battery_darwin.go
CFArrayGetCount
called by 2
internal/macos/corefoundation.go

Shape

Function 38
Method 13
Struct 4
TypeAlias 2

Languages

Go100%

Modules by API surface

internal/macos/corefoundation.go24 symbols
battery.go14 symbols
internal/macos/iokit.go6 symbols
cmd/battery/main.go6 symbols
internal/macos/battery.go2 symbols
battery_windows.go2 symbols
internal/macos/abi.go1 symbols
battery_linux.go1 symbols
battery_darwin.go1 symbols

For agents

$ claude mcp add battery \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact