Aller au contenu principal

Herbstluftwm

Manual tiling window manager for X11 using Xlib and Glib. The layout is based on splitting frames into subframes which can be split again or can be filled with windows (similar to i3/ musca). Tags (or workspaces or virtual desktops or …) can be added/removed at runtime. Each tag contains its own layout. Exactly one tag is viewed on each monitor. The tags are monitor independent (similar to xmonad). It is configured at runtime via ipc calls from herbstclient. So the configuration file is just a script which is run on startup.

img

Installation

Once you finish installing Archcraft, Herbstluftwm can be installed on the top of it. It's pre-configured and ready to go. Open a terminal and run the following command to install it :

$ sudo pacman -Sy archcraft-herbstluftwm

Configuration

Herbstluftwm is pre-configured in Archcraft. In this section, We'll see how the Herbstluftwm window manager is configured, what tools and utilities are used to make it look and work like a complete desktop environment.

Config Structure

The configuration structure of Herbstluftwm in Archcraft looks something like this:

~/.config
└── herbstluftwm : herbstluftwm config directory
├── alacritty : terminal config
├── scripts : scripts used for herbstluftwm
├── theme : desktop theme (polybar, rofi configs)
├── autostart : main herbstluftwm config file
├── dunstrc : dunst config for notifications
├── picom.conf : compositor config
└── xsettingsd : gtk themes, icons and fonts config file

Terminal

Alacritty is the default terminal. In the Herbstluftwm window manager, alacritty is launched with an alternative config file. If you need to change anything, make sure you modify the config files in ~/.config/herbstluftwm/alacritty directory. These are the following config files you can modify to change the behaviour of your terminal:

~/.config/herbstluftwm/alacritty/alacritty.toml : Main configuration file
~/.config/herbstluftwm/alacritty/colors.toml : Colors configurations
~/.config/herbstluftwm/alacritty/fonts.toml : Fonts configurations

If you need any help with alacritty config, run : man 5 alacritty in terminal.

Notification

Dunst is used as a notification daemon for notifications in Herbstluftwm. In the Herbstluftwm window manager, dunst is launched with an alternative config file, which is ~/.config/herbstluftwm/dunstrc. So, If you need to modify anything, make sure you edit this file.

If you need any help with dunst config, run : man 5 dunst in terminal.

Wallpaper

hsetroot sets the wallpaper in the Herbstluftwm. If you want to change the wallpaper, Edit ~/.config/herbstluftwm/scripts/herb_autostart script and add the path to your wallpaper :

# Restore wallpaper
hsetroot -cover '/path/to/your/wallpaper'
#hsetroot -solid "#BDBAB5"

Statusbar

Polybar is used as the statusbar in Archcraft's Herbstluftwm window manager.

The configurations for polybar can be found inside the theme directory directory of Herbstluftwm ~/.config/herbstluftwm/theme

If you want to modify the polybar settings, or perhaps want to add/remove modules, then you need to edit the following files :

~/.config/herbstluftwm/theme/polybar/config.ini : Main config file
~/.config/herbstluftwm/theme/polybar/colors.ini : Colors config file
~/.config/herbstluftwm/theme/polybar/modules.ini : Modules config file

If you need any help with polybar config, visit : polybar wiki

Launchers and Applets

Rofi is used for application launchers, command runner and various applets. To modify the rofi config, edit ~/.config/rofi/config.rasi file.

If you need any help with rofi config, run : man rofi in terminal.

The scripts for rofi that are used in Herbstluftwm can be found it ~/.config/herbstluftwm/scripts directory. These are the following scripts that uses rofi to provide the launchers and applets in Herbstluftwm :

rofi_askpass : rofi based sudo frontend to get root password
rofi_asroot : applet to open apps as root
rofi_bluetooth : bluetooth applet to quickly connect to BT devices
rofi_launcher : an application launcher, cmd runner, file manager and task manager
rofi_music : music applet, that controls MPD with mpc
rofi_powermenu : power menu, with confirmation dialog
rofi_runner : quickly lets you run a command
rofi_screenshot : screenshot applet that works with maim
rofi_windows : applet to manage opened windows

If you want to modify any applet or perhaps want to extend the functionality of the applet, just edit these scripts above.

The configuration of each script can be found inside the theme directory of Herbstluftwm ~/.config/herbstluftwm/theme

Let's say you want to modify the looks of launcher, then you need to edit the ~/.config/herbstluftwm/theme/rofi/launcher.rasi file. Same goes for every other applet, Edit the respective file in the same directory.

If you need any help with rofi theming, run : man rofi-theme in terminal.

To change the colors and fonts of the launchers and applets, Edit the ~/.config/herbstluftwm/theme/rofi/shared/colors.rasi and ~/.config/herbstluftwm/theme/rofi/shared/fonts.rasi files.

Compositor

Picom is used for compositing. It's a lightweight compositor with shadowing, advanced blurring and fading. In Herbstluftwm, picom is launched with an alternative config file, which is ~/.config/herbstluftwm/picom.conf.

If you need to change anything related to picom, Edit this picom config file.

If you need any help with picom config, check the picom's default config file in /etc/xdg/picom.conf

info

If you're having screen-tearing issues, using glx backend can solve this issue.
If you're facing lagging, hangs and freezes, try switching between xrender and glx backend.

Window Manager

The configuration of Herbstluftwm is available in ~/.config/herbstluftwm. To configure Herbstluftwm window manager, this is the main file that is used :

autostart : main configuration file responsible for determining the behaviour and settings of the overall session. Edit this file to set window rules, configure tags, layouts, and herbstluftwm appearance.

If you need any help with herbstluftwm configuration, visit : herbstluftwm.org

Keybindings

Here's a list of some important keybinds you need to know for operating Herbstluftwm easily. If you want to view, modify or add new keybinds, Edit ~/.config/herbstluftwm/autostart file.

Applications

KeysAction
super + ReturnOpen terminal (alacritty)
super + shift + ReturnOpen floating terminal
super + alt + ReturnOpen fullscreen terminal
super + shift + FOpen file manager (thunar)
super + shift + EOpen text editor (geany)
super + shift + WOpen web browser (firefox)
KeysAction
superOpen application launcher
alt + F1Open application launcher
alt + F2Open command runner
super + NOpen network manager applet
super + BOpen bluetooth applet
super + MOpen music applet
super + XOpen powermenu applet
super + SOpen screenshots applet
super + ROpen apps as root applet
super + WOpen window applet

Hardware Keys

KeysAction
PrintTake screenshot
alt + PrintTake screenshot in 5 seconds delay
shift + PrintTake screenshot in 10 seconds delay
ctrl + PrintTake screenshot of currently focused window
super + PrintTake screenshot of selected area
XF86AudioRaiseVolumeIncrease volume
XF86AudioLowerVolumeDecrease volume
XF86AudioMuteToggle mute speakers
XF86AudioMicMuteToggle mute microphone
XF86Audio + Next/Prev/Play/StopMedia controls (MPD)
XF86MonBrightnessUpIncrease display brightness
XF86MonBrightnessDownDecrease display brightness

Workspaces

KeysAction
super + 1..9Switch to respective tag
super + shift + 1..9Send focused client to respective tag
super + Comma/PeriodCycle through tags
super + BackSpaceCycle monitor

Window Management

KeysAction
super + CClose focused client
super + Left/Right/Up/DownFocus left, right, top and bottom clients respectively
super + H/L/K/JFocus left, right, top and bottom clients respectively
super + shift + Left/Right/Up/DownMove clients in tiling and floating mode
super + shift + H/L/K/JMove clients in tiling and floating mode
super + ctrl + Left/Right/Up/DownResize frames and floating clients
super + ctrl + H/L/K/JResize frames and floating clients
super + USplitting frames, create an empty frame at bottom
super + OSplitting frames, create an empty frame in right
super + ctrl + SLet the current frame explode into subframes
super + DRemove subframes
super + TabCycle clients
alt + TabCycle clients
super + IJump to urgent client
super + FToggle fullscreen
super + shift + SpaceToggle focus between floating and tiled clients
super + ctrl + SpaceToggle floating
super + shift + MFocus minimized clients
super + ctrl + MJump to last minimized client
super + GToggle pseudotile
super + SpaceCycles through the available layouts

Window Manager

KeysAction
super + shift + RReload herbstluftwm
super + shift + QQuit herbstluftwm

Misc Keys

KeysAction
ctrl + alt + MOpen ncmpcpp with album art in terminal
ctrl + alt + LTrigger lockscreen
super + PRun colorpicker
super + EscapeRun xkill

Screenshots

Here's few screenshots of Herbstluftwm desktop. These'll give you an idea of the experience of Herbstluftwm in Archcraft.

Desktop 1Desktop 2Desktop 3Desktop 4
imgimgimgimg
Desktop 5Desktop 6Desktop 7Desktop 8
imgimgimgimg
Desktop 9Desktop 10Desktop 11Desktop 12
imgimgimgimg
Desktop 13Desktop 14Desktop 15Desktop 16
imgimgimgimg

FAQs

How to update my config to new configs?

When a new version of Archcraft Herbstluftwm get released, And you update the system by sudo pacman -Syu or you update the Herbstluftwm package by sudo pacman -S archcraft-herbstluftwm, New config files get installed as herbstluftwm_pacnew_YYYY-MM-DD in your ~/.config directory.

To use new configs, backup your old ~/.config/herbstluftwm directory and move ~/.config/herbstluftwm_pacnew_YYYY-MM-DD to ~/.config/herbstluftwm and login again.

How to change GTK theme, icons and cursor?

To change GTK theme, icons and cursor in Herbstluftwm session, Edit ~/.config/herbstluftwm/xsettingsd file and restart Herbstluftwm to apply the changes.

Net/ThemeName "Adwaita-dark"
Net/IconThemeName "Zafiro"
Gtk/CursorThemeName "Qogirr"
How to manage multiple monitors and resolution in Herbstluftwm?

If you use multiple monitors with Herbstluftwm window manager, you can manage them by running Manager Monitors or archcraft-randr app.

Why Alacritty is not working on my computer?

Since Alacritty is a OpenGL based terminal emulator, It may not work on some computer hardwares. You can make it work on such computers by following these methods :

  1. Open alacritty with LIBGL_ALWAYS_SOFTWARE=1 variable. Edit the keybindings/script launching alacritty and replace alacritty with LIBGL_ALWAYS_SOFTWARE=1 alacritty
  2. Edit /usr/share/applications/Alacritty.desktop desktop file and replace Exec=alacritty with Exec=env LIBGL_ALWAYS_SOFTWARE=1 alacritty