From 40612cc4c23e907ab50d72a0ae6be9980fb7b887 Mon Sep 17 00:00:00 2001 From: Ondrej Novak Date: Mon, 6 Jul 2026 22:51:14 +0200 Subject: [PATCH] add readme --- README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f64cc56 --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +# waybar-collectd + +A Waybar graphing utility inspired by the Gnome 2 Panel system indicator. It uses collectd's `unixsock` plugin to gather metrics and renders images for the `waybar-image` plugin. + +## Installation +```bash +cargo install --git https://forgejo.cerno.ch/handy/waybar-collectd.git +``` + +## Configuring collectd +Install and configure `collectd` with the `unixsock` plugin. For per-second updates, adjust the sampling interval. Ensure `collectd` is enabled to start on boot. + +**Example config (`/etc/collectd.d/waybar.conf`):** +```conf +Interval 1 # Sample data every 1 second + +LoadPlugin unixsock + +# Enable the plugins you want to use +LoadPlugin cpu +LoadPlugin memory +LoadPlugin disk +LoadPlugin network +``` + +```bash +sudo systemctl enable --now collectd +``` + +## Configuring waybar-collectd +Define your graphs and data sources in `config.toml`. To ensure the daemon runs on login, use a user systemd unit or your WM configuration. + +### User systemd unit example +`~/.config/systemd/user/waybar-hwmonitor-daemon.service` +```ini +[Unit] +Description=Data collection daemon for waybar hw monitor + +[Service] +Type=simple +ExecStart=%h/.cargo/bin/waybar-collectd --config %h/.config/waybar/modules/waybar-collectd-config.toml +Restart=on-failure +RestartSec=2s + +[Install] +WantedBy=default.target +``` + +## Configuring Waybar +Add a module for each graph to your Waybar config. Ensure the `size` matches the rendered image dimensions. + +**Example config (`~/.config/waybar/config`):** +```json +[ + { + "layer": "bottom", + "position": "top", + "modules-center": ["image#net", "image#disk", "image#mem", "image#cpu"], + "height": 24, + "image#cpu": { + "path": "/tmp/waybar-graphs/cpu.png", + "size": 120, + "interval": 1 + }, + "image#mem": { + "path": "/tmp/waybar-graphs/mem.png", + "size": 120, + "interval": 1 + }, + "image#disk": { + "path": "/tmp/waybar-graphs/disk.png", + "size": 120, + "interval": 1 + }, + "image#net": { + "path": "/tmp/waybar-graphs/net.png", + "size": 120, + "interval": 1 + } + } +] +```