Skip to content
Stein Gunnar Bakkeby edited this page May 15, 2019 · 29 revisions

Where to start

To get started, copy the sample configuration:

$ install -Dm644 /usr/local/share/doc/polybar/config $HOME/.config/polybar/config
$ polybar example

This sample configuration may not be fully functional on your machine without modifications. It is meant to be a starting point and to showcase the different configuration options.

Note: The sample configuration may be also located at /usr/share/doc/polybar/config depending on how you installed polybar.

See the Configuration wiki page for more details on how to configure the bar.

Running the app

Usage: polybar [OPTION]... BAR

  -h, --help               Display this help and exit
  -v, --version            Display build details and exit
  -l, --log=LEVEL          Set the logging verbosity (default: WARNING)
                           LEVEL is one of: error, warning, info, trace
  -q, --quiet              Be quiet (will override -l)
  -c, --config=FILE        Path to the configuration file
  -r, --reload             Reload when the configuration has been modified
  -d, --dump=PARAM         Print value of PARAM in bar section and exit
  -m, --list-monitors      Print list of available monitors and exit
  -w, --print-wmname       Print the generated WM_NAME and exit
  -s, --stdout             Output data to stdout instead of drawing it to the X window
  -p, --png=FILE           Save png snapshot to FILE after running for 3 seconds

Launching the bar in your wm's bootstrap routine

Create an executable file containing the startup logic, for example $HOME/.config/polybar/

#!/usr/bin/env bash

# Terminate already running bar instances
killall -q polybar

# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done

# Launch bar1 and bar2
polybar bar1 &
polybar bar2 &

echo "Bars launched..."

Make it executable:

$ chmod +x $HOME/.config/polybar/

If you are using bspwm, add the following line to bspwmrc:


If you are using i3, add the following lines to your configuration:

exec_always --no-startup-id $HOME/.config/polybar/

and remove these

bar {
    i3bar_command i3bar

The first line executes the startup script; the second disables i3's default bar

Override monitor

By defining a reference to an environment variable you could override the monitor at launch:

monitor = ${env:MONITOR:fallback-value}
$ MONITOR=override-value polybar mybar

Dealing with XRandR 1.5+ randomized monitor names

If your polybar configuration uses the monitor configuration variable and sometimes fails to start because XRandR 1.5+ is creating randomized monitor names, you can fix this by specifying the MONITOR environment variable as shown above, and setting it in your script like this:

MONITOR=$(polybar -m|tail -1|sed -e 's/:.*$//g')

i3: Make the bar appear below windows

To allow other windows to be placed above the bar, or to avoid having the bar visible when in fullscreen mode, you need to use the following two parameters. Note that it will tell the window manager to back off so no area will be reserved, etc.

override-redirect = true
wm-restack = i3
You can’t perform that action at this time.