https://github.com/doums/bato
Small program to send battery notifications
https://github.com/doums/bato
battery battery-notification desktop-notification notification
Last synced: 22 days ago
JSON representation
Small program to send battery notifications
- Host: GitHub
- URL: https://github.com/doums/bato
- Owner: doums
- Created: 2020-07-26T21:01:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T00:32:59.000Z (almost 3 years ago)
- Last Synced: 2025-06-23T00:05:20.162Z (5 months ago)
- Topics: battery, battery-notification, desktop-notification, notification
- Language: Rust
- Homepage:
- Size: 919 KB
- Stars: 39
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
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
The binary looks for the config file `bato.toml` located in
`$XDG_CONFIG_HOME/bato/` (default to `$HOME/.config/bato/`).\
If the config file is not found, 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