Warning: THE VOID WIKI IS DEPRECATED. It is no longer being maintained, contains outdated and incorrect information, and will eventually be shut down. Please refer to the Void Handbook, https://docs.voidlinux.org/, for the official documentation. If you can't find the information you're seeking, please raise an issue at https://github.com/void-linux/void-docs/issues

Herbstluftwm -

From Void Linux Wiki
Jump to navigation Jump to search


# xbps-install -S herbstluftwm

Optional, you can install dependencies to make your life easier:

# xbps-install -S dmenu dzen2


Append to your ~/.xinitrc (or replace, depending on how you have it set up):

exec herbstluftwm


Copy /etc/xdg/herbstluftwm/autostart file to ~/.config/herbstluftwm/autostart. You can edit that file for your needs. Make sure the autostart file is executable, else you will probably end up without keybindings!

The configuration of herbstluftwm can be updated on-the-fly by running herbstclient reload (See #Commands). Autostart is called on each reload, therefore within autostart you typically unmap all existing configuration first.

It is recommended to edit autostart prior to launching herbstluftwm due to the defaults not applying to all systems. Unless your system happens to be very generic, it will not work out of the box. At the very least, try to adapt your terminal program. This is easily done by editing the line starting hc keybind $Mod-return. If you installed the recommended dependencies, you may want to add a keybind to open dmenu. This can be done simply by adding a line to autostart along the lines of hc keybind $Mod-d spawn dmenu. Other application launchers will work in the same way.

Multi-Monitor Support

Herbstluftwm supports multiple monitors as a virtual concept; monitors in herbstluftwm do not have to match the real monitor configuration as reported by xrandr. It brings a lot of flexibility and gives the user more control over his/her monitor-arrangement. You can use herbstclient detect_monitors to automatically adapt to the physical setup. Otherwise, see the manpage on how to add, remove, resize and move monitors. Tags in a multi-monitor set-up are not "owned" by a monitor. This means that when one monitor switches to a tag that is active in another monitor, the two monitors will swap tags.


Herbstclient is a very powerful tool, as it provides you with full control over your window manager from the command line.

There is a tab-completion for the parameters for herbstclient. Try herbstclient list_commands to show all parameters.

Right now there is no error message if you use wrong parameters on a command, but only a non-zero return value. If you do not show the return value of a command anyway (e.g. in your $SHELL-prompt), you might want to echo $? to find the return value of the last command.

Autostart programs

The easiest way to autostart programs on run is to create an autorun bash script and then run it via autostart. create ~/.config/herbstluftwm/autorun with some basic programs defined in it.

#! /bin/bash
picom -b &
dunst &
feh --bg-scale ~/wallpaper.jpg &

Then edit ~/.config/herbstluftwm/autostart to include:

# Autorun
[[ -z "$HLWM_LOADED" ]] && ~/.config/herbstluftwm/autorun &

You'll need to make sure that file is also executable.