https://github.com/drdeimos/polybar_another_battery
Simple battery charge level watcher with libnotify usage
https://github.com/drdeimos/polybar_another_battery
Last synced: 5 months ago
JSON representation
Simple battery charge level watcher with libnotify usage
- Host: GitHub
- URL: https://github.com/drdeimos/polybar_another_battery
- Owner: drdeimos
- License: gpl-3.0
- Created: 2017-11-10T10:33:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-20T19:03:59.000Z (over 1 year ago)
- Last Synced: 2024-08-03T03:01:42.560Z (9 months ago)
- Language: Go
- Size: 84 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Polybar - Battery Level
README
# About
Simple battery charge level watcher with notifications (libnotify)
# Requirements
- (Build) go1.17
- (Build) libnotify-dev, pkg-config
- (Run) Font for battery indicator - 3270Medium NF
- (Run) libnotify
- (Run) UPower (`-time-to` flag)# Packages
- [PPA for Ubuntu](https://launchpad.net/~drdeimosnn/+archive/ubuntu/survive-on-wm)
# Build manually
```
go get -u github.com/distatus/battery/cmd/battery
make build
```# Usage
Run with key `-h` for get actual help
```
$ ./polybar-ab -h
Usage of ./polybar-ab:
-debug
Enable debug output to stdout
-font int
Set font numbler for polybar output (default 1)
-once
Check state and print once
-polybar
Print battery level in polybar format
-simple
Print battery level to stdout every check
-thr int
Set threshould battery level for notifications (default 10)
-time-to
Print "time to full" or "time to empty"
-version
Print version info and exit```
## Polybar
Built in [polybar](https://github.com/jaagr/polybar) support.
Add flag `-polybar` for get stdout output in polybar format:
### Polybar module example
```
[module/custom-battery]
type = custom/script
exec = polybar-ab -polybar -thr 10 -font 6 -time-to
tail = true
```# TODO
- [x] ETA battery life when discharging
- [ ] Battery health level (based on full/design capacity)