Herbstluftwm

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.

herbstluftwm is a manual tiling window manager for X11. It supports both tiling and floating windows as well as virtual desktops (tags) and immediate reloading of configuration files without the need to restart the window manager. Herbstluftwm also allows the user to split their screen space into multiple monitors, allowing for a setup where one monitor can have multiple virtual desktops visible at a time. Configuration is done exclusively using herbstclient which will send commands to a running herbstluftwm via Xlib.

Installation

USE flags

USE flags for x11-wm/herbstluftwm A manual tiling window manager for X

+doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
python Add optional support/bindings for the Python language
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

Emerge

To install herbstluftwm using Portage simply run this command:

root #emerge --ask x11-wm/herbstluftwm

Additional software

The default configuration ships with a script (panel.sh) which depends on x11-misc/dzen.

USE flags for x11-misc/dzen General purpose messaging, notification, and menu utility

xinerama Add support for querying multi-monitor screen geometry through the Xinerama API
xpm Add support for XPM graphics format

Install dzen if you want to use the default configuration provided by Herbstluftwm:

root #emerge --ask x11-misc/dzen

Rofi

Rofi is a window switcher, application launcher and dmenu replacement.

USE flags for x11-misc/rofi A window switcher, run dialog and dmenu replacement

+drun Enable desktop file run dialog
+windowmode Enable normal window mode
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

To add a keybind (Alt+d) for Rofi modify the autostart file:

FILE ~/.config/herbstluftwm/autostartAdding a keybind for Rofi
hc keybind $Mod-d spawn rofi -show drun

Polybar

Polybar is a fast, easy-to-use and highly configurable status bar.

USE flags for x11-misc/polybar A fast and easy-to-use tool for creating status bars

alsa Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
curl Add support for client-side URL transfer library
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
i3wm Add support for i3 window manager
ipc Add support for Inter-Process Messaging
mpd Add support for Music Player Daemon
network Enable network support
pulseaudio Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)

To automatically launch Polybar from your autostart file add a spawn command:

FILE ~/.config/herbstluftwm/autostartLaunching Polybar automatically
hc spawn polybar --config=~/.config/polybar/config.ini

Starting herbstluftwm

To start herbstluftwm, either use a display manager or the command startx. To use startx with elogind support, setup elogind and create the following file:

FILE ~/.xinitrc
exec dbus-launch --exit-with-session herbstlufwm

Configuration

The default configuration file is a good starting point for users who want to write their own configuration. First create the necessary directory for the configuration file:

user $mkdir -p ~/.config/herbstluftwm

Now copy the default configuration file from /etc/xdg/herbstluftwm/autostart into the directory created above:

user $cp /etc/xdg/herbstluftwm/autostart ~/.config/herbstluftwm/

The ~/.config/herbstluftwm/autostart file is a regular shell script (similar to Bspwm) that by default will be executed by Bash. For all list of all commands that herbstclient can send see the section "COMMANDS" in the man page.

Autostart programs

FILE ~/.config/herbstluftwm/autostart
# Automatically start these programs
spawn syncthing
spawn dunst
spawn feh --bg-scale ~/Pictures/wallpaper.png

Herbstluftwm also provides tab-completion for herbstclient commands for both Bash and Zsh.

Bash users need to source the /etc/bash_completion.d/herbstclient_completion file from inside their ~/.bashrc.

FILE ~/.bashrcEnabling herbstclient tab-completion for Bash
# Add this to the end of your ~/.bashrc
source /etc/bash_completion.d/herbstclient_completion

For Zsh tab-completion should be enabled by default, if it is not, activate it with these instructions.

See also

  • Bspwm - a lightweight, tiling, minimalist window manager
  • Polybar - a fast and easy-to-use status bar

External resources