Kwybars
Development

Overview

Developer quick start, control commands, and build or QA workflow.

This section is for contributors working on Kwybars itself rather than end users setting it up on their desktop.

Workspace

git clone https://github.com/naurissteins/Kwybars.git
cd Kwybars

Dependencies

On Arch Linux:

sudo pacman -S --needed rust gtk4 gtk4-layer-shell pipewire cava

# optional desktop error notifications
sudo pacman -S --needed libnotify

Common Developer Commands

Run overlay:

cargo run -p kwybars-overlay

Run daemon:

cargo run -p kwybars-daemon

Run with a specific config:

cargo run -p kwybars-overlay -- --config /path/to/config.toml
cargo run -p kwybars-daemon -- --config /path/to/config.toml

Use the control tool:

cargo run -p kwybarsctl -- switch-config /path/to/config.toml
cargo run -p kwybarsctl -- image-overlay match --overlay-dir /path/to/overlays /path/to/wallpaper.jpg
cargo run -p kwybarsctl -- validate-config /path/to/config.toml
cargo run -p kwybarsctl -- doctor /path/to/config.toml
cargo run -p kwybarsctl -- list-themes /path/to/config.toml

Build and QA

Format:

cargo fmt --all

Lint:

cargo clippy --workspace --all-targets -- -D warnings

Compile check:

cargo check --workspace

Test:

cargo test --workspace

Release build:

cargo build --release --workspace

Logging

Kwybars uses tracing logs to stderr and to a file.

  • KWYBARS_LOG or RUST_LOG controls the log level or filter
  • KWYBARS_LOG_FILE overrides the default log file path
  • timestamps are written in local time

Nix

Kwybars ships Nix support for development shells, package builds, runnable apps, and a NixOS module.

Development shells:

  • nix develop
  • nix-shell

Package build:

nix build
./result/bin/kwybars-daemon

Runnable flake apps:

nix run .
nix run .#kwybars-overlay
nix run .#kwybarsctl

NixOS module entrypoint:

imports = [ inputs.kwybars.nixosModules.default ];
programs.kwybars.enable = true;

The flake package installs the three binaries, bundled themes, example config, and user systemd service. The wrapped binaries set KWYBARS_THEMES_DIR so packaged themes are discovered from the Nix store.

For crate and module layout details, continue with Internals.

On this page