https://github.com/doums/bato
A program to send battery level notifications
https://github.com/doums/bato
battery battery-notification desktop-notification notification notify rust
Last synced: about 1 month ago
JSON representation
A program to send battery level notifications
- Host: GitHub
- URL: https://github.com/doums/bato
- Owner: doums
- Created: 2020-07-26T21:01:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2026-04-19T23:17:22.000Z (about 1 month ago)
- Last Synced: 2026-04-20T01:15:40.340Z (about 1 month ago)
- Topics: battery, battery-notification, desktop-notification, notification, notify, rust
- Language: Rust
- Homepage:
- Size: 952 KB
- Stars: 43
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/doums/bato/actions?query=workflow%3Atest)
[](https://aur.archlinux.org/packages/bato/)
## bato
A program to send **bat**tery level n**o**tifications

[features](#features) - [prerequisite](#prerequisite) - [install](#install) - [configuration](#configuration) - [usage](#usage) - [license](#license)
### Features
Tiny configuration in toml.
Desktop notification:
- level full
- level low
- level critical
- charging
- discharging
### Prerequisite
A desktop notification server, like [Dunst](https://dunst-project.org/)
### Install
- latest [release](https://github.com/doums/bato/releases/latest)
- AUR [package](https://aur.archlinux.org/packages/bato)
### Configuration
By default, bato looks for the config file `~/.config/bato/bato.toml`
(XDG_CONFIG_HOME).\
To use a custom file, run with the `--config` flag.\
If the config file is not found or invalid, bato prints an error and exits.
All config options are detailed [here](https://github.com/doums/bato/blob/master/bato.toml).
Example:
```toml
tick_rate = 2
critical_level = 5
low_level = 20
full_design = true
[charging]
summary = "Battery"
body = "Charging"
icon = "battery-good-charging"
[discharging]
summary = "Battery"
body = "Discharging"
icon = "battery-good"
[full]
summary = "Battery"
body = "Full"
icon = "battery-full"
[low]
summary = "Battery"
body = "Low"
icon = "battery-low"
[critical]
summary = "Battery"
body = "Critical!"
icon = "battery-caution"
urgency = "critical"
```
### Usage
Run bato via your window manager or desktop environment autostart system
Example with XMonad
```haskell
myStartupHook = do
spawnOnce "dunst"
spawnOnce "bato -lfile"
```
> [!TIP]
> By default bato logs to stdout. To log into a file
run with `-lfile`. Logs are located in `~/.cache/bato/`
```shell
bato -h
```
### License
Mozilla Public License 2.0