/battery

Primary LanguageGo

battery

Based on distatus/battery.

GoDoc Travis

Installation

$ go get -u github.com/LEI/battery
$ cd $GOPATH/src/github.com/LEI/battery
$ dep ensure -vendor-only
$ go install github.com/LEI/battery

Usage

$ battery -h
battery [flags] [format]
    -c, --color   Enable color output
    -s, --spark   Enable sparkline bar
    -t, --tmux    Enable tmux status bar colors

Default format:

$ battery '{{.Id}}: {{.State}}, {{.Percent}}%{{if ne .Duration ""}}, {{end}}{{.Duration}}'
BAT0: Full, 100%

Example:

$ battery --spark '{{.Bar}}'
█ 100%