An open API service indexing awesome lists of open source software.

https://github.com/cdown/bats

Simple battery status tool
https://github.com/cdown/bats

Last synced: about 1 month ago
JSON representation

Simple battery status tool

Awesome Lists containing this project

README

        

bats is an extremely simple battery status printer written in bash. It uses
[sysfs][sysfs] to get the battery data, so right now it is Linux-specific.

## Usage

$ # Will show information about all available batteries
$ bats
42DFF
$ # Explicitly choose a battery
$ bats BAT1
76C

## Output

The output is in the following format ``. The percentage is
the remaining battery charge left, which is calculated by totalling all of the
battery capacities together and getting a percentage compared to the current
charge.

### Status symbols:

The status symbols transparently represent the battery status as provided by
`battery.h`:

- C: Charging
- D: Discharging
- N: Not charging (eg. due to battery threshold)
- F: Full
- U: Unknown

[sysfs]: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt