2019-08-20 18:51:53 +00:00
waybar(5)
# NAME
waybar - configuration file
# DESCRIPTION
2019-08-24 17:11:03 +00:00
The configuration uses the JSON file format and is named *config*.
2019-08-20 18:51:53 +00:00
2019-08-26 21:33:10 +00:00
Valid locations for this file are:
2019-08-20 18:51:53 +00:00
2019-08-29 03:05:03 +00:00
- *$XDG_CONFIG_HOME/waybar/config*
2019-08-26 21:33:10 +00:00
- *~/.config/waybar/config*
- *~/waybar/config*
- */etc/xdg/waybar/config*
2020-09-29 20:31:28 +00:00
- *@sysconfdir@/xdg/waybar/config*
2019-08-20 18:51:53 +00:00
2020-04-20 12:04:02 +00:00
A good starting point is the default configuration found at https://github.com/Alexays/Waybar/blob/master/resources/config
2019-08-26 21:27:03 +00:00
Also a minimal example configuration can be found on the at the bottom of this man page.
2019-08-20 18:51:53 +00:00
2019-08-26 21:27:03 +00:00
# BAR CONFIGURATION
2019-08-20 18:51:53 +00:00
2019-08-24 16:19:32 +00:00
*layer* ++
typeof: string ++
default: bottom ++
2020-01-03 14:50:05 +00:00
Decide if the bar is displayed in front (*top*) of the windows or behind (*bottom*)
them.
2019-08-24 16:19:32 +00:00
*output* ++
typeof: string|array ++
2020-02-18 21:15:16 +00:00
Specifies on which screen this bar will be displayed. Exclamation mark(*!*) can be used to exclude specific output.
2022-12-06 18:05:08 +00:00
Output specification follows sway's and can either be the output port such as "HDMI-A-1" or a string consisting of the make, model and serial such as "Some Company ABC123 0x00000000". See *sway-output(5)* for details.
2023-03-13 00:44:07 +00:00
In an array, star '*\**' can be used at the end to accept all outputs, in case all previous entries are exclusions.
2019-08-24 16:19:32 +00:00
*position* ++
typeof: string ++
default: top ++
2019-08-26 21:30:18 +00:00
Bar position, can be *top*, *bottom*, *left*, *right*.
2019-08-24 16:19:32 +00:00
*height* ++
typeof: integer ++
2019-08-26 21:33:10 +00:00
Height to be used by the bar if possible. Leave blank for a dynamic value.
2019-08-24 16:19:32 +00:00
*width* ++
typeof: integer ++
2019-08-26 21:33:10 +00:00
Width to be used by the bar if possible. Leave blank for a dynamic value.
2019-08-24 16:19:32 +00:00
*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 ++
2019-08-26 21:33:10 +00:00
Margins value using the CSS format without units.
2019-08-24 16:19:32 +00:00
*margin-<top\|left\|bottom\|right>* ++
typeof: integer ++
Margins value without units.
2021-10-20 09:15:49 +00:00
*spacing* ++
typeof: integer ++
Size of gaps in between of the different modules.
2019-08-24 16:19:32 +00:00
*name* ++
typeof: string ++
Optional name added as a CSS class, for styling multiple waybars.
2021-11-20 05:02:29 +00:00
*mode* ++
typeof: string ++
Selects one of the preconfigured display modes. This is an equivalent of the sway-bar(5) *mode* command and supports the same values: *dock*, *hide*, *invisible*, *overlay*. ++
Note: *hide* and *invisible* modes may be not as useful without Sway IPC.
2023-07-04 20:35:15 +00:00
*start_hidden* ++
typeof: bool ++
default: *false* ++
Option to start the bar hidden.
*modifier-reset* ++
2022-04-14 12:39:42 +00:00
typeof: string ++
default: *press*
Defines the timing of modifier key to reset the bar visibility.
To reset the visibility of the bar with the press of the modifier key use *press*.
Use *release* to reset the visibility upon the release of the modifier key and only if no other action happened while the key was pressed. This prevents hiding the bar when the modifier is used to switch a workspace, change binding mode or start a keybinding.
2021-05-22 05:38:48 +00:00
*exclusive* ++
typeof: bool ++
2021-11-24 03:18:24 +00:00
default: *true* ++
2021-05-22 05:38:48 +00:00
Option to request an exclusive zone from the compositor. Disable this to allow drawing application windows underneath or on top of the bar.
2021-12-28 12:57:10 +00:00
*fixed-center* ++
typeof: bool ++
default: *true*
Prefer fixed center position for the `modules-center` block. The center block will stay in the middle of the bar whenever possible. It can still be pushed around if other blocks need more space.
When false, the center block is centered in the space between the left and right block.
2021-05-22 05:38:48 +00:00
*passthrough* ++
typeof: bool ++
2021-11-24 03:18:24 +00:00
default: *false* ++
2021-05-22 05:38:48 +00:00
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.
2020-01-03 14:46:59 +00:00
*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.
2021-11-20 04:28:57 +00:00
*ipc* ++
typeof: bool ++
default: false ++
Option to subscribe to the Sway IPC bar configuration and visibility events and control waybar with *swaymsg bar* commands. ++
Requires *bar_id* value from sway configuration to be either passed with the *-b* commandline argument or specified with the *id* option.
*id* ++
typeof: string ++
*bar_id* for the Sway IPC. Use this if you need to override the value passed with the *-b bar_id* commandline argument for the specific bar instance.
2021-06-23 21:08:47 +00:00
*include* ++
2021-07-10 20:22:37 +00:00
typeof: string|array ++
2021-09-15 15:00:23 +00:00
Paths to additional configuration files.
Each file can contain a single object with any of the bar configuration options. In case of duplicate options, the first defined value takes precedence, i.e. including file -> first included file -> etc. Nested includes are permitted, but make sure to avoid circular imports.
For a multi-bar config, the include directive affects only current bar configuration object.
2021-06-23 21:08:47 +00:00
2019-08-26 17:20:22 +00:00
# MODULE FORMAT
2019-08-20 18:51:53 +00:00
You can use PangoMarkupFormat (See https://developer.gnome.org/pango/stable/PangoMarkupFormat.html#PangoMarkupFormat).
e.g.
```
"format": "<span style=\"italic\">{}</span>"
```
2019-08-24 20:46:56 +00:00
# MULTIPLE INSTANCES OF A MODULE
2019-08-20 18:51:53 +00:00
If you want to have a second instance of a module, you can suffix it by a '#' and a custom name.
2019-08-26 21:30:18 +00:00
For example if you want a second battery module, you can add *"battery#bat2"* to your modules.
2019-08-20 18:51:53 +00:00
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": {
2019-08-24 17:11:03 +00:00
"bat": "BAT1"
2019-08-20 18:51:53 +00:00
},
"battery#bat2": {
2019-08-24 17:11:03 +00:00
"bat": "BAT2"
2019-08-20 18:51:53 +00:00
}
```
2019-08-26 21:27:03 +00:00
# MINIMAL CONFIGURATION
2019-08-20 18:51:53 +00:00
2019-08-24 17:11:03 +00:00
A minimal *config* file could look like this:
2019-08-20 18:51:53 +00:00
```
{
2019-08-24 17:11:03 +00:00
"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}"
}
2019-08-20 18:51:53 +00:00
}
```
2019-08-26 21:27:03 +00:00
# MULTI OUTPUT CONFIGURATION
2019-08-20 18:51:53 +00:00
2019-08-24 17:11:03 +00:00
## Limit a configuration to some outputs
2019-08-20 18:51:53 +00:00
```
{
2019-08-24 17:11:03 +00:00
"layer": "top",
2019-08-20 18:51:53 +00:00
"output": "eDP-1",
2019-08-24 17:11:03 +00:00
"modules-left": ["sway/workspaces", "sway/mode"],
2019-08-20 18:51:53 +00:00
...
}
```
```
{
2019-08-24 17:11:03 +00:00
"layer": "top",
2019-08-20 18:51:53 +00:00
"output": ["eDP-1", "VGA"],
2019-08-24 17:11:03 +00:00
"modules-left": ["sway/workspaces", "sway/mode"],
2019-08-20 18:51:53 +00:00
...
}
```
2019-08-24 17:11:03 +00:00
## Configuration of multiple outputs
2019-08-20 18:51:53 +00:00
2019-08-24 17:11:03 +00:00
Don't specify an output to create multiple bars on the same screen.
2019-08-20 18:51:53 +00:00
```
[{
2019-08-24 17:11:03 +00:00
"layer": "top",
2019-08-20 18:51:53 +00:00
"output": "eDP-1",
2019-08-24 17:11:03 +00:00
"modules-left": ["sway/workspaces", "sway/mode"],
2019-08-20 18:51:53 +00:00
...
}, {
"layer": "top",
"output": "VGA",
2019-08-24 17:11:03 +00:00
"modules-right": ["clock"],
2019-08-20 18:51:53 +00:00
...
}]
```
2019-08-24 17:11:03 +00:00
## Rotating modules
2019-08-20 18:51:53 +00:00
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:
```
{
2019-08-24 17:11:03 +00:00
"clock": {
"rotate": 90
}
2019-08-20 18:51:53 +00:00
}
```
Valid options for the "rotate" property are: 0, 90, 180 and 270.
2019-08-26 17:20:22 +00:00
2021-10-31 22:55:13 +00:00
## Grouping modules
Module groups allow stacking modules in the direction orthogonal to the bar direction. When the bar is positioned on the top or bottom of the screen, modules in a group are stacked vertically. Likewise, when positioned on the left or right, modules in a group are stacked horizontally.
A module group is defined by specifying a module named "group/some-group-name". The group must also be configured with a list of contained modules. Example:
```
{
"modules-right": ["group/hardware", "clock"],
"group/hardware": {
2022-06-13 19:17:17 +00:00
"orientation": "vertical",
2021-10-31 22:55:13 +00:00
"modules": [
"cpu",
"memory",
"battery"
]
},
...
}
```
2022-06-13 19:17:17 +00:00
Valid options for the (optional) "orientation" property are: "horizontal", "vertical", "inherit", and "orthogonal" (default).
2019-08-26 17:20:22 +00:00
# SUPPORTED MODULES
- *waybar-backlight(5)*
- *waybar-battery(5)*
2020-08-04 18:54:14 +00:00
- *waybar-bluetooth(5)*
2023-07-19 17:44:52 +00:00
- *waybar-cava(5)*
2019-08-26 17:20:22 +00:00
- *waybar-clock(5)*
- *waybar-cpu(5)*
- *waybar-custom(5)*
2020-08-04 18:54:14 +00:00
- *waybar-disk(5)*
2019-08-26 17:20:22 +00:00
- *waybar-idle-inhibitor(5)*
2023-01-22 12:16:46 +00:00
- *waybar-image(5)*
2021-04-15 21:41:15 +00:00
- *waybar-keyboard-state(5)*
2019-08-26 17:20:22 +00:00
- *waybar-memory(5)*
2020-07-03 10:14:01 +00:00
- *waybar-mpd(5)*
2021-11-01 18:17:29 +00:00
- *waybar-mpris(5)*
2019-08-26 17:20:22 +00:00
- *waybar-network(5)*
- *waybar-pulseaudio(5)*
2022-05-31 20:28:09 +00:00
- *waybar-river-mode(5)*
2020-08-04 18:54:14 +00:00
- *waybar-river-tags(5)*
2022-05-31 20:28:09 +00:00
- *waybar-river-window(5)*
2023-01-31 05:34:38 +00:00
- *waybar-river-layout(5)*
2020-08-04 18:54:14 +00:00
- *waybar-states(5)*
2019-08-26 17:20:22 +00:00
- *waybar-sway-mode(5)*
2022-08-30 18:27:30 +00:00
- *waybar-sway-scratchpad(5)*
2019-08-26 17:20:22 +00:00
- *waybar-sway-window(5)*
- *waybar-sway-workspaces(5)*
2023-01-13 00:17:11 +00:00
- *waybar-wireplumber(5)*
2020-05-30 10:07:38 +00:00
- *waybar-wlr-taskbar(5)*
2020-08-07 21:09:35 +00:00
- *waybar-wlr-workspaces(5)*
2019-08-26 17:20:22 +00:00
- *waybar-temperature(5)*
- *waybar-tray(5)*
2022-12-06 18:05:08 +00:00
# SEE ALSO
*sway-output(5)*