https://github.com/codemicro/batmon
Basic Golang program to monitor battery charge level
https://github.com/codemicro/batmon
Last synced: about 2 months ago
JSON representation
Basic Golang program to monitor battery charge level
- Host: GitHub
- URL: https://github.com/codemicro/batmon
- Owner: codemicro
- License: mit
- Created: 2021-11-21T21:23:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-21T22:39:25.000Z (over 4 years ago)
- Last Synced: 2025-03-06T09:26:40.683Z (over 1 year ago)
- Language: Go
- Size: 208 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# batmon
*Basic Golang program to monitor battery charge level*
---
`batmon` is a basic utility designed to be in the background of a system to monitor its battery level. Only Linux is supported.
### Installation
The following requires at least version 1.16 of the Go SDK installed, and to have GOPATH on your PATH.
```
go install github.com/codemicro/batmon@latest
```
### Usage
Start at startup, for example with `cron`:
```
@reboot /home/akp/go/bin/batmon
```
Note that `batmon` is blocking.
### Battery information
Battery capacity is retrieved from `/sys/class/power_supply/BAT0/capacity` by default. This can be changed in the `batteryPath` constant in `main.go`.