No description
- Rust 99.9%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .githooks | ||
| alfred | ||
| alfred-core | ||
| alfred-ytm | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| README.md | ||
alfred
A personal system telemetry daemon for the Linux desktop.
Architecture
alfred serve # persistent daemon, managed by systemd --user
alfred get <module> # one-shot query for scripts/waybar/debugging
alfred stream <module> # optional long-lived NDJSON client
alfred status # check if daemon is running
alfred completions zsh > _alfred # generate shell completion
Modules
| Module | Source | Interval |
|---|---|---|
system |
/proc/stat, /proc/meminfo, sysfs hwmon |
2s |
gpu |
NVML (libnvidia-ml) |
5s |
audio |
wpctl / pactl subprocesses |
2s |
media |
D-Bus MPRIS via zbus |
5s |
network |
/sys/class/net |
5s |
storage |
statvfs + sysfs hwmon |
30s |
llama |
HTTP localhost:8080/metrics |
2s |
ytmd |
YTMD companion HTTP + Socket.IO | 5s |
hyprland |
Hyprland IPC | 1s |
API
GET /:module → latest cached JSON (one-shot)
GET /stream/:module → newline-delimited JSON stream (push on update)
POST /control/:module/:action → trigger an action, forces immediate refresh
Config
~/.config/alfred/config.toml
Waybar integration
Waybar 0.15.0 has been more reliable here with normal polling than with
long-lived interval: 0 stream consumers, so the recommended setup is:
"custom/system": {
"interval": 2,
"exec": "alfred get system",
"return-type": "json",
"format": "{}"
}
alfred stream <module> is still available for other long-lived consumers.
Systemd
~/.config/systemd/user/alfred.service
Shell completions
Generate a zsh completion file:
alfred completions zsh > ~/.local/share/zsh/site-functions/_alfred
Then make sure that directory is in fpath before compinit, e.g. in ~/.zshrc:
fpath=(~/.local/share/zsh/site-functions $fpath)
autoload -U compinit
compinit