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.14+) β 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 && cd zig-waybar-contrib
# Build all modules
zig build
# Install to system
sudo cp -r zig-out/bin/* /usr/local/bin/
Add to your Waybar configuration (~/.config/waybar/config.jsonc
):
{
// Load default 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",
"custom/memory#zwc",
"custom/ping#zwc"
],
// π οΈ Custom modules configuration
"custom/updates#zwc": {
"exec": "/usr/bin/waybar-module-updates-bin",
"return-type": "json",
"interval": 0,
"signal": 10,
"escape": true
},
"custom/gpu#zwc": {
"exec": "/usr/bin/waybar-module-gpu-bin",
"return-type": "json",
"interval": 0,
"signal": 11
},
"custom/memory#zwc": {
"exec": "/usr/bin/waybar-module-memory-bin",
"return-type": "json",
"interval": 0,
"signal": 12
},
"custom/ping#zwc": {
"exec": "/usr/bin/waybar-module-ping-bin",
"return-type": "json",
"interval": 0,
"signal": 13
}
}
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)
β β βββ format.zig # Byte/usage formatting helpers (e.g., human-readable memory)
β β
β βββ 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.