Xmobar is a minimalistic status bar. It was originally designed and implemented to work with xmonad, but it is actually usable with any window manager in X11 and also (via its text output mode) Wayland.
Xmobar was inspired by the Ion3 status bar, and supports similar features, like dynamic color management, icons, output templates, and extensibility through plugins. It is also able to write to standard output, in a variety of formats.
These are some xmobar screenshots using one of the authors’ configuration:
Check the change log for our release history. We also have an IRC
channel, #xmobar
, at Libera.
Xmobar is probably available from your distributions package
manager! Most distributions compile xmobar with the all_extensions
flag, so you don’t have to.
pacman -S xmobar
apt install xmobar
zypper install xmobar
xbps-install xmobar
emerge --ask xmobar
Xmobar is available from Hackage, and you can install it using
cabal-install
:
cabal install xmobar
Starting with version 0.35.1, xmobar now requires at least GHC version 8.4.x. to build. See this issue for more information.
See compiling for a list of optional compilation flags that will enable some optional plugins. For instance, to install xmobar with all the bells and whistles (this is probably what you want), use:
cabal install xmobar --flags="all_extensions"
See compiling.
You can run xmobar with:
xmobar /path/to/config &
or
xmobar &
if you have the default configuration file saved as
$XDG_CONFIG_HOME/xmobar/xmobarrc
(defaulting to
~/.config/xmobar/xmobarrc
), or ~/.xmobarrc
.
By default, xmobar will run as an X11 application, in a docked window, but it is possible to redirect xmobar’s to the standard output, optionally with color escape sequences. In this mode, xmobar can be run inside a terminal o console, or its output piped to other applications, and there is no need for an X11 display (so, for instance, you could pipe xmobar’s output to a Wayland application, such as swaybar.)
To run xmobar in text mode, either pass the -T
flag to its
invocation:
xmobar -T /path/to/config &
or set the parameter textOutput
to True in its configuration. You
can also specify the format of color escapes, for instance,
omitting them altogether with Plain
:
xmobar -TPlain /path/to/config &
Other options are Ansi
, Pango
, and Swaybar
.
In text mode, xmobar can be told to ouput its information using
pango markup for colors and fonts, and it that way you can use it
with swaybar or waybar, if you don’t have actions or boxes in your
template. Here’s a minimal bar
configuration for sway’s
configuration file:
bar {
status_command xmobar -TPango
pango_markup enabled
}
In case you want to use boxes around text or click actions in your
template, you can use instead the format Swaybar
, which supports
both. This output format follows the JSON swaybar-protocol
defined by swaybar. Configure it simply with:
bar {
status_command xmobar -TSwaybar
}
- If you want to jump straight into running xmobar, head over to the quick start guide.
- If you want to get a detailed overview of all available plugins and monitors, visit the plugins index.
- Interfacing with window managers describes plugins and extensions for interacting with xmobar from your window manager.
- If you want to know how to contribute to the xmobar project, check out contributing.
- If you want to write your own plugins, see Write your own plugin.
- For elaborated examples of how to use xmobar as a Haskell library to create your monitors, see this repo at jao/xmobar-config.
- To understand the internal mysteries of xmobar you may try reading this tutorial on X Window Programming in Haskell.
Andrea Rossato originally designed and implemented xmobar up to version 0.11.1. Since then, it is maintained and developed by jao, with the help of the greater xmobar and Haskell communities.
In particular, xmobar incorporates patches by Mohammed Alshiekh, Alex Ameen, Axel Angel, Dhananjay Balan, Claudio Bley, Dragos Boca, Ben Boeckel, Ivan Brennan, Duncan Burke, Roman Cheplyaka, Patrick Chilton, Antoine Eiche, Nathaniel Wesley Filardo, Guy Gastineau, John Goerzen, Patrick Günther, Reto Hablützel, Juraj Hercek, Tomáš Janoušek, Ada Joule, Spencer Janssen, Roman Joost, Pavel Kalugin, Jochen Keil, Sam Kirby, Lennart Kolmodin, Krzysztof Kosciuszkiewicz, Dmitry Kurochkin, Todd Lunter, Vanessa McHale, Robert J. Macomber, Dmitry Malikov, David McLean, Joan MIlev, Marcin Mikołajczyk, Dino Morelli, Tony Morris, Eric Mrak, Thiago Negri, Edward O’Callaghan, Svein Ove, Martin Perner, Jens Petersen, Alexander Polakov, Sibi Prabakaran, Pavan Rikhi, Petr Rockai, Andrew Emmanuel Rosa, Sackville-West, Amir Saeid, Markus Scherer, Daniel Schüssler, Olivier Schneider, Alexander Shabalin, Valentin Shirokov, Peter Simons, Alexander Solovyov, Will Song, John Soo, John Soros, Felix Springer, Travis Staton, Artem Tarasov, Samuli Thomasson, Edward Tjörnhammar, Sergei Trofimovich, Thomas Tuegel, John Tyree, Jan Vornberger, Anton Vorontsov, Daniel Wagner, Zev Weiss, Phil Xiaojun Hu, Nikolay Yakimov, Edward Z. Yang, Leo Zhang, Norbert Zeh, and Michał Zielonka.
Andrea wants to thank Robert Manea and Spencer Janssen for their help in understanding how X works. They gave him suggestions on how to solve many problems with xmobar. He also thanks Claus Reinke for making him understand existential types (or at least for letting him think he grasps existential types…;-).
This software is released under a BSD-style license. See license for more details.
Copyright © 2010-2022 Jose Antonio Ortega Ruiz
Copyright © 2007-2010 Andrea Rossato