MCPcopy Index your code
hub / github.com/doums/bato

github.com/doums/bato @v0.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.1 ↗ · + Follow
66 symbols 101 edges 17 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

bato bato

bato

A program to send battery level notifications

bato

features - prerequisite - install - configuration - usage - license

Features

Tiny configuration in toml.

Desktop notification:

  • level full
  • level low
  • level critical
  • charging
  • discharging

Prerequisite

A desktop notification server, like Dunst

Install

Configuration

By default, bato looks for the config file ~/.config/bato/bato.toml (XDG dir spec).\ 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.

[!TIP] Keep tick_rate low to save battery. Bato uses udev to listen to AC events,\ so it notifies instantly on charger plug/unplug.

Example:

tick_rate = 30 # sec
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

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/

bato -h

License

Mozilla Public License 2.0

Extension points exported contracts — how you extend this code

FsmState (Interface)
(no doc) [6 implementers]
src/fsm/fsm.rs

Core symbols most depended-on inside this repo

notify
called by 5
src/lib.rs
update
called by 3
src/lib.rs
check_dir_or_create
called by 2
src/util.rs
check_dir
called by 2
src/util.rs
rotate_log_file
called by 1
src/trace.rs
get_filter
called by 1
src/trace.rs
init
called by 1
src/trace.rs
check_system_path
called by 1
src/lib.rs

Shape

Method 35
Class 13
Function 12
Enum 5
Interface 1

Languages

Rust100%

Modules by API surface

src/lib.rs9 symbols
src/fsm/fsm_impl.rs6 symbols
src/config.rs6 symbols
src/fsm/states/not_charging.rs5 symbols
src/fsm/states/low.rs5 symbols
src/fsm/states/full.rs5 symbols
src/fsm/states/discharging.rs5 symbols
src/fsm/states/critical.rs5 symbols
src/fsm/states/charging.rs5 symbols
src/fsm/fsm.rs5 symbols
src/trace.rs3 symbols
src/cli.rs3 symbols

For agents

$ claude mcp add bato \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact