erffy/zig-waybar-contrib
β¨ Lightweight Waybar modules built with Zig
IMPORTANT This project is in active development. As I'm learning Zig, updates may take time. Your contributions, feedback, and patience are greatly appreciated! π
High-performance Waybar modules written in Zig for efficient system monitoring
zig-waybar-contrib
is a collection of lightweight, blazingly fast Waybar modules built with Zig. These modules are designed to provide accurate system monitoring with minimal resource usage, taking advantage of Zig's performance characteristics and memory safety.
ReleaseFast
+ LTO + LLVMAll modules output single-line JSON compatible with Waybarβs
custom
module interface.
Updates β Tracks system package updates
fakeroot
GPU β Monitors GPU usage, temperature, memory, and fan/PWM
rocm-smi-lib
, amdsmi
, or cuda
Memory β RAM usage and statistics
Ping β Measures network latency
You can easily install the latest version of zig-waybar-contrib from the AUR.
This package provides pre-built binaries as waybar-module-X-bin
.
Use your preferred AUR helper:
# Using paru
paru -S zig-waybar-contrib
# Using yay
yay -S zig-waybar-contrib
Requirements:
zig
(0.15.x) β for building the codegit
β for cloning the repositoryrocm-smi-lib
, amdsmi
β AMD GPU backend (optional)cuda
β NVIDIA GPU backend (optional)# Clone the repository
git clone https://github.com/erffy/zig-waybar-contrib.git
# or clone from AUR
git clone https://aur.archlinux.org/zig-waybar-contrib.git
# cd to source
cd zig-waybar-contrib
# Install to system*
makepkg --si
# Build all modules**
zig build -Drelease
# Install to system**
for f in zig-out/bin/*; do
sudo cp -r $f /usr/local/bin/waybar-module-$f
done
*
: Run this command if you cloned from AUR
**
: Run this command if you cloned from GitHub
Add to your Waybar configuration (~/.config/waybar/config.jsonc
):
{
// Load module configurations from zig-waybar-contrib
"include": [
"/etc/zig-waybar-contrib/config.jsonc"
],
// Display these modules on the right side of the Waybar
"modules-right": [
"custom/updates#zwc",
"custom/gpu#zwc", // use only if you have installed GPU dependency
"custom/memory#zwc",
"custom/ping#zwc"
]
}
zig-waybar-contrib/
β
βββ README.md # Project overview, installation, and usage instructions
βββ CHANGELOG.md # Version history with detailed changes per release
βββ LICENSE # Project license (GPL-3.0-only)
βββ config.waybar.jsonc # Example Waybar module configuration (JSONC format)
βββ .gitignore # Git exclusions for build artifacts, cache files, etc.
β
βββ build.zig # Zig build script for compiling all modules
βββ build.zig.zon # Zig package and dependency declaration (Zon format)
β
βββ tests/ # Test files
β
βββ src/ # Source code
β β
β βββ utils/ # Shared utility modules
β β βββ mod.zig # Module loader and common interfaces
β β βββ waybar.zig # Waybar signal sender (e.g., USR1/USR2 signaling)
β β
β βββ gpu/ # GPU statistics and backend integration
β β βββ gpu.zig # Unified GPU module (auto-selects backend at compile time)
β β βββ backend/ # Individual backend implementations
β β βββ amdsmi.zig # AMD SMI interface (ROCm 5.x+)
β β βββ rocmsmi.zig # Legacy ROCm SMI interface
β β βββ nvml.zig # NVIDIA GPU interface (via NVML/CUDA)
β β
β βββ memory.zig # Module for tracking and displaying memory usage
β βββ ping.zig # Module for displaying ping/latency to a target host
β βββ updates.zig # Module for checking for system/package updates
β
βββ assets/ # Images, screenshots, and other media assets
Contributions are welcome! Here's how you can help:
git checkout -b feature/amazing-module
zig fmt src/
Made with β€οΈ by Me
Star β this repo if you find it useful!
This project is licensed under the GNU General Public License v3.0. See LICENSE for details.