Waybar Documentation

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:

11,592 stars C++ C++ 1 file Β· ~1,883 tokens #bar#gtk#i3status#statusbar#sway#wayland#wlroots
RAW Doc

File: README.md

Waybar




Highly customizable Wayland bar for Sway and wlroots-based compositors.
Available in all major distributions.

Installation Β· Wiki Β· Configuration Β· Styling Β· Examples Β· FAQ

Features

Compositor integration

Compositor Workspaces / Tags Window Layout Language Mode
Sway βœ… βœ… βœ… βœ…
River βœ… βœ… βœ… βœ…
Hyprland βœ… βœ… βœ… βœ…
Niri βœ… βœ… βœ…
Mango βœ… βœ… βœ… βœ… βœ…
DWL βœ… βœ…
Wayfire βœ… βœ…

DWL requires the dwl IPC patch.

Modules

…and more. Every module is documented on the wiki (see the Modules sidebar).

Getting started

bash
git clone https://github.com/Alexays/Waybar
cd Waybar
meson setup build
ninja -C build
./build/waybar          # run without installing

Waybar launches with a sensible default config. To make
it yours, copy the default config and stylesheet into ~/.config/waybar/ and edit
them. The Configuration
and Styling guides cover every
option, and Examples has
ready-to-use community setups.

Installation

Waybar is packaged by most distributions:

An Ubuntu PPA with more recent versions is available here.

Building from source

bash
git clone https://github.com/Alexays/Waybar
cd Waybar
meson setup build
ninja -C build
ninja -C build install   # optional

Runtime dependencies

text
gtkmm3       jsoncpp      libsigc++    fmt          wayland
chrono-date  spdlog       xkbregistry  libgtk-3-dev upower

libpulse             [Pulseaudio module]
libnl                [Network module]
libappindicator-gtk3 [Tray module]
libdbusmenu-gtk3     [Tray module]
libmpdclient         [MPD module]
libsndio             [sndio module]
libevdev             [KeyboardState module]

Build dependencies

text
cmake   meson   scdoc   wayland-protocols

Install dependencies β€” Ubuntu

bash
sudo apt install \
  clang-tidy gobject-introspection libdbusmenu-gtk3-dev libevdev-dev \
  libfmt-dev libgirepository1.0-dev libgtk-3-dev libgtkmm-3.0-dev \
  libinput-dev libjsoncpp-dev libmpdclient-dev libnl-3-dev libnl-genl-3-dev \
  libpulse-dev libsigc++-2.0-dev libspdlog-dev libwayland-dev scdoc upower \
  libxkbregistry-dev

Install dependencies β€” Arch

bash
pacman -S --asdeps \
  gtkmm3 jsoncpp libsigc++ fmt wayland chrono-date spdlog gtk3 \
  gobject-introspection libgirepository libpulse libnl libappindicator-gtk3 \
  libdbusmenu-gtk3 libmpdclient sndio libevdev libxkbcommon upower meson \
  cmake scdoc wayland-protocols glib2-devel

Contributing

Contributions are welcome β€” see CONTRIBUTING.md. The style
guidelines are Google's C++ style.

Docs live in the man pages. Module documentation is written in
man/ (scdoc) and auto-synced to the wiki. Edit the man page, not the
wiki β€” see .github/wiki.

[!CAUTION]
Distributions of Waybar are only released on the official GitHub page.
Waybar does not have an official website. Do not trust any site claiming to be official.

License

Waybar is licensed under the MIT license. See LICENSE for details.


File: resources/custom_modules/cffi_example/README.md

C FFI module

A C FFI module is a dynamic library that exposes standard C functions and
constants, that Waybar can load and execute to create custom advanced widgets.

Most language can implement the required functions and constants (C, C++, Rust,
Go, Python, ...), meaning you can develop custom modules using your language of
choice, as long as there's GTK bindings.

Symbols to implement are documented in the
waybar_cffi_module.h file.

Usage

Building this module

bash
meson setup build
meson compile -C build

Load the module

Edit your waybar config:

json
{
	// ...
	"modules-center": [
		// ...
		"cffi/c_example"
	],
	// ...
	"cffi/c_example": {
		// Path to the compiled dynamic library file
		"module_path": "resources/custom_modules/cffi_example/build/wb_cffi_example.so"
	}
}