Skip to content

erffy/zig-waybar-contrib

Repository files navigation

Important

Versioning Notice (as of Zig 0.16)
Starting with Zig 0.16, this project’s major version will increase by 1 with each new Zig release.
This change helps clearly indicate which project version corresponds to which Zig version.

Important

Branch Information
The version v1.4.2 is the final release for the 0.15.x branch.
Please use and update the actively maintained 0.16.x branch.

Note

This project is under active development.
As I continue learning Zig, updates may take some time — your contributions, feedback, and patience are greatly appreciated!

zig-waybar-contrib License: GPL v3

High-performance Waybar modules written in Zig for efficient system monitoring

Overview

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.

Features

  • Ultra-Fast Execution - Optimized with LTO + LLVM
  • 🔒 Memory Safe - No buffer overflows or memory leaks
  • 📊 Real-Time Data - Accurate, up-to-date system metrics
  • 🎯 Waybar Native - JSON output format, seamless integration
  • 🪶 Lightweight - Minimal system dependencies

Available Modules

All modules output single-line JSON compatible with Waybar’s custom module interface.

  • Updates – Tracks system package updates

    • Dependencies: fakeroot
    • Platforms: Arch Linux
    • Signal: 10
  • GPU – Monitors GPU usage, temperature, memory, and fan/PWM

    • Dependencies: rocm-smi-lib, amdsmi, or cuda
    • Platforms: Any Linux
    • Signal: 11
    • Notes: Currently Intel GPUs is not supported
  • Memory – RAM usage and statistics

    • Platforms: Any Linux
    • Signal: 12
  • Ping – Measures network latency

    • Platforms: Any Linux
    • Signal: 13
  • CPU - Monitors CPU (per-core) usage and frequencies

    • Platforms: Any Linux
    • Signal: 14

Screenshots

Updates

Updates Module

GPU

GPU Module

Memory

Memory Module

Ping

Ping Module

Installation

Quick Installation

You can easily install the latest version of zig-waybar-contrib from the AUR. This package provides pre-built binaries as waybar-module-X.

Use your preferred AUR helper:

# Using paru
paru -S zig-waybar-contrib

# Using yay
yay -S zig-waybar-contrib

Build from Source

Requirements:

  • zig (0.15.x) — for building the code
  • git — for cloning the repository
  • rocm-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

Configuration

{
  // 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",
    "custom/gpu", // use only if you have installed GPU dependency
    "custom/memory",
    "custom/ping",
    "custom/cpu"
  ]
}

Contributing

Contributions are welcome! Here's how you can help:

Code Contributions

  • 🐛 Bug Fixes - Help squash issues
  • Performance Improvements - Make modules even faster
  • 🧩 New Modules - Add support for more system metrics
  • 🎨 Code Quality - Improve readability and maintainability

Other Ways to Help

  • 📖 Documentation - Improve guides and examples
  • 🧪 Testing - Report bugs and compatibility issues
  • 💡 Feature Requests - Suggest new modules or improvements

Development Workflow

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-module
  3. Make your changes and test thoroughly
  4. Follow Zig style conventions: zig fmt src/
  5. Add tests if applicable
  6. Submit a pull request with a clear description

Acknowledgments

  • Zig Team - For creating an amazing systems programming language
  • Waybar Contributors - For the excellent status bar that makes this possible
  • Community - For feedback, bug reports, and contributions

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.