Skip to content

erffy/zig-waybar-contrib

Repository files navigation

Important

I'm looking for someone to maintain this project in the Fedora COPR repositories.
If you're interested in maintaining it, please don't hesitate to reach out.

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.
Also these modules are drop-in replacement for Waybar's built-in modules

Modules

See MODULES

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.16.x) — for building the project
  • git — for cloning the repository
  • rocm-smi-lib, amdsmi — AMD GPU backend (optional)
  • cuda — NVIDIA GPU backend (optional)

Manual Build

# Clone the repository
git clone --branch 0.16-dev https://github.com/erffy/zig-waybar-contrib

# Enter the source directory
cd zig-waybar-contrib

# Build all modules
zig build -Drelease

# Install binaries to system (requires sudo)
for f in zig-out/bin/*; do
  sudo cp -r $f "/usr/local/bin/waybar-module-$f"
done

Script Installation

The installation script automates cloning, building, and installing.
It requires the following tools:

  • bash — to run the script
  • gum — for styled output and prompts
  • curl — to download the script
  • git — to clone or update the repository
  • zig — to build the project
bash -c "$(curl -fsSL https://raw.githubusercontent.com/erffy/zig-waybar-contrib/0.16-dev/install.sh)"

The script will automatically:

  1. Check for required dependencies
  2. Clone or update the repository
  3. Build the project using Zig
  4. Install the binaries to your user

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.


Alt