Difference between revisions of "Polybar"

From ArchWiki
Jump to: navigation, search
(Added / started new page. Covers Polybar, a relatively popular status bar for window managers.)
(No difference)

Revision as of 13:18, 10 September 2018

polybar is a fast and easy-to-use tool for creating status bars. It aims to be easily customizable, utilising many modules which enable a wide range of (editable) functionality, such as displaying workspaces, the date, or system volume. Polybar is especially useful for Window Managers that have a limited or non-existent status bar, such as awesome or i3. Polybar can also be used on full Desktop Environments like Plasma.


Install the polybarAUR package. The development version is polybar-gitAUR.


Running Polybar

Polybar can be run with the following:

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

However you will probably want to run Polybar with your Window Managers bootstrap routine. See #Running with WM

Running with WM

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

#!/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..."

This script will mean that restarting your WM will also restart Polybar.


If using bspwm, add the following to bspwmrc:


If using i3, add the following to your configuration:

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