Skip to content
Robin edited this page Nov 12, 2018 · 2 revisions

Config file

The configuration uses the JSON file format and is named config.

Valid directories for this file are:

  • ~/.config/waybar/
  • ~/waybar/
  • /etc/xdg/waybar/

A good starting point is the example config.

Also a minimal example config can be found on the bottom of this page.

All valid options for the modules are listed on the modules page.

Multiple instances of a module

If you want to have a second instance of a module, you can suffix it by a '#' and a custom name.

For example if you want a second battery module, you can add "battery#bat2" to your modules.

To configure the newly added module, you than also add a module configuration with the same name.

This could than look then look something like this (this is an incomplete example):

"modules-right": ["battery", "battery#bat2"],
"battery": {
    "bat": "BAT1"
},
"battery#bat2": {
    "bat": "BAT2"
}

Minimal config

A minimal config file could look like this:

{
    "layer": "top",
    "modules-left": ["sway/workspaces", "sway/mode"],
    "modules-center": ["sway/window"],
    "modules-right": ["battery", "clock"],
    "sway/window": {
        "max-length": 50
    },
    "battery": {
        "format": "{capacity}% {icon}",
        "format-icons": ["", "", "", "", ""]
    },
    "clock": {
        "format-alt": "{:%a, %d. %b  %H:%M}"
    }
}

Clone this wiki locally