waybar - Man Page

configuration file

Description

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

Valid locations for this file are:

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

A good starting point is the default configuration found at https://github.com/Alexays/Waybar/blob/master/resources/config Also a minimal example configuration can be found on the at the bottom of this man page.

Bar Configuration

layer
typeof: string
default: bottom
Decide if the bar is displayed in front (top) of the windows or behind (bottom)

them.

output
typeof: string|array
Specifies on which screen this bar will be displayed. Exclamation mark(!) can be used to exclude specific output.

position
typeof: string
default: top
Bar position, can be top, bottom, left, right.

height
typeof: integer
Height to be used by the bar if possible. Leave blank for a dynamic value.

width
typeof: integer
Width to be used by the bar if possible. Leave blank for a dynamic value.

modules-left
typeof: array
Modules that will be displayed on the left.

modules-center
typeof: array
Modules that will be displayed in the center.

modules-right
typeof: array

Modules that will be displayed on the right.

margin
typeof: string
Margins value using the CSS format without units.

margin-<top|left|bottom|right>
typeof: integer
Margins value without units.

name
typeof: string
Optional name added as a CSS class, for styling multiple waybars.

exclusive
typeof: bool
default: true unless the layer is set to overlay
Option to request an exclusive zone from the compositor. Disable this to allow drawing application windows underneath or on top of the bar.

passthrough
typeof: bool
default: false unless the layer is set to overlay
Option to pass any pointer events to the window under the bar.

Intended to be used with either top or overlay layers and without exclusive zone.

gtk-layer-shell
typeof: bool
default: true
Option to disable the use of gtk-layer-shell for popups.

Only functional if compiled with gtk-layer-shell support.

include
typeof: string|array
Paths to additional configuration files. In case of duplicate options, the including file's value takes precedence. Make sure to avoid circular imports.

For a multi-bar config, specify at least an empty object for each bar also in every file being included.

Module Format

You can use PangoMarkupFormat (See https://developer.gnome.org/pango/stable/PangoMarkupFormat.html#PangoMarkupFormat).

e.g.

  "format": "<span style="italic">{}</span>"

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 then also add a module configuration with the same name.

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

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

Minimal Configuration

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}"
  	}
  }

Multi Output Configuration

Limit a configuration to some outputs

  {
  	"layer": "top",
  	"output": "eDP-1",
  	"modules-left": ["sway/workspaces", "sway/mode"],
  	...

}
  {
  	"layer": "top",
  	"output": ["eDP-1", "VGA"],
  	"modules-left": ["sway/workspaces", "sway/mode"],
  	...
  }

Configuration of multiple outputs

Don't specify an output to create multiple bars on the same screen.

  [{
  	"layer": "top",
  	"output": "eDP-1",
  	"modules-left": ["sway/workspaces", "sway/mode"],
  	...
  }, {
  	"layer": "top",
  	"output": "VGA",
  	"modules-right": ["clock"],
  	...
  }]

Rotating modules

When positioning Waybar on the left or right side of the screen, sometimes it's useful to be able to rotate the contents of a module so the text runs vertically. This can be done using the "rotate" property of the module. Example:

  {
  	"clock": {
  		"rotate": 90
  	}
  }

Valid options for the "rotate" property are: 0, 90, 180 and 270.

Supported Modules

Referenced By

waybar-river-tags(5).

2021-11-03