Minimal single-threaded async status updater that writes your system summary into the X11 root window name. Pair it with a bar (e.g. dwm) and keep your status lean, fast, and configurable in Rust.
the preview uses dwm and the statuscolors patch.
- Per-source refresh intervals (
CPU,RAM,battery,commands,shell scripts,date/time). - Centralized
errorhandling: failures log tostderrand showerron the bar. - Configurable output format strings with replacement.
- Simple percentage helpers with saturating math for stable output.
- Spawns external
Command/Shellsources as separate processes, while orchestration runs on a singleasyncruntime thread.
For a release build/run (with timezone filtering to shrink binary size):
CHRONO_TZ_TIMEZONE_FILTER="(Europe/Vienna)" cargo build --releaseEdit src/config.rs to change the displayed sources, order, and formatting.
format: how the value is embedded (uses{}as the replacement marker by default).default: raw placeholder shown until the first successful fetch (also passed throughformat).interval: seconds between updates for that source; missed ticks are skipped for long runs.timeout: seconds before aCommand/Shellrun is considered hung and returnserr.Sourceoptions:Cpu,Ram,Battery,Command,Shell Script,DateTime.
Example snippet (from src/config.rs):
Status {
source: Source::Command {
cmd: "curl",
args: &["-fsS", "wttr.in?format=%c%t"],
timeout: 120,
},
format: "",
default: "...",
interval: 600,
},check out src/config.rs for more examples.
Each status runs serially: a new run does not start until the previous one finishes.
If a run exceeds its interval, missed ticks are skipped and the next run starts immediately after completion.
Command and Shell use per-source timeout (seconds). On timeout, the status logs an error and shows err.
CPU: reads/proc/stat, reports total CPU usage percent.RAM: usesMemTotalandMemAvailablefrom/proc/meminfo.Battery: reads capacity from/sys/class/power_supply/<NAME>/capacity.Command: runs the given program withargsin a separate process; uses per-sourcetimeout(seconds).Shell: runs the given script viash -cin a separate process; uses per-sourcetimeout(seconds).Date/time: formats with the configuredchrono_tztimezone (adjust inconfig.rs).