Go to file
Ondrej Novak 40612cc4c2
add readme
2026-07-06 22:57:30 +02:00
draw fix oldest samples not being removed 2026-06-25 23:22:18 +02:00
protocol implement generic observable 2026-06-14 22:08:05 +02:00
waybar-collectd create image output parent directory if nonexistent 2026-07-06 22:26:46 +02:00
.gitignore add gitignore 2026-06-14 21:18:17 +02:00
Cargo.lock pass config path via cli 2026-06-30 20:59:02 +02:00
Cargo.toml wip: drawing 2026-06-06 22:30:06 +02:00
README.md add readme 2026-07-06 22:57:30 +02:00
config.toml make sampling period configurable 2026-06-30 22:20:53 +02:00

README.md

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

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):

Interval 1  # Sample data every 1 second

LoadPlugin unixsock

# Enable the plugins you want to use
LoadPlugin cpu
LoadPlugin memory
LoadPlugin disk
LoadPlugin network
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

[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):

[
	{
    "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
    }		
	}
]