Skip to main content

Xmonad

Xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximizing screen use. Xmonad is written, configured and extensible in Haskell. Custom layout algorithms, key bindings and other extensions may be written by the user in configuration files. Layouts are applied dynamically, and different layouts may be used on each workspace. Xinerama is fully supported, allowing windows to be tiled on several physical screens.

video

Xmonad Premium

The Ultimate Xmonad Configuration With Modular Configs, Extra Functionality And Themes (27 Pre-Made + Infinite Auto Generated Themes With pywal)

Get Xmonad Premium From ko-fi And Support Archcraft Development.

Installation

Once you finish installing Archcraft, Xmonad 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 the regular version of Xmonad :

$ sudo pacman -Sy archcraft-xmonad
Archcraft Prime

Xmonad Premium is not pre-installed on Archcraft Prime ISO

Configuration

Xmonad is pre-configured in Archcraft. In this section, We'll see how the Xmonad 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 Xmonad in Archcraft looks something like this:

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

Terminal

Alacritty is the default terminal. In the Xmonad 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/xmonad/alacritty directory. These are the following config files you can modify to change the behaviour of your terminal:

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

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

warning

When you change the theme, the colors.toml and fonts.toml file get overwritten by the theme script.

This is applicable only in Xmonad Premium as themes are only available in it. On regular version, there's only one theme.

Notification

Dunst is used as a notification daemon for notifications in Xmonad. In the Xmonad window manager, dunst is launched with an alternative config file, which is ~/.config/xmonad/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.

warning

When you change the theme, the fonts and colors in dunstrc file get overwritten by the theme script.

This is applicable only in Xmonad Premium as themes are only available in it. On regular version, there's only one theme.

Wallpaper

hsetroot sets the wallpaper in the Xmonad. If you want to change the wallpaper, Edit the following scripts :

Edit ~/.config/xmonad/scripts/xmonad_autostart script and add the path to your wallpaper.

# Restore wallpaper
hsetroot -cover '/path/to/your/wallpaper'

Statusbar

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

The configurations for polybar can be found inside the theme directory directory of Xmonad ~/.config/xmonad/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/xmonad/theme/polybar/config.ini : Main config file
~/.config/xmonad/theme/polybar/colors.ini : Colors config file
~/.config/xmonad/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 Xmonad can be found it ~/.config/xmonad/scripts directory. These are the following scripts that uses rofi to provide the launchers and applets in Xmonad :

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_themes : applet to change the themes only in premium
rofi_windows : applet to manage open 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 Xmonad ~/.config/xmonad/theme

Let's say you want to modify the looks of launcher, then you need to edit the ~/.config/xmonad/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/xmonad/theme/rofi/shared/colors.rasi and ~/.config/xmonad/theme/rofi/shared/fonts.rasi files.

Compositor

Picom is used for compositing. It's a lightweight compositor with shadowing, advanced blurring and fading. In Xmonad, picom is launched with an alternative config file, which is ~/.config/xmonad/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.

warning

When you change the theme, things like backend, shadows, blurring in picom.conf file gets overwritten by theme script.

This is applicable only in Xmonad Premium as themes are only available in it. On regular version, there's only one theme.

Window Manager

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

~/.config/xmonad/xmonad.hs : main xmonad config file with general settings, keybindings, layouts and window rules.

If you need any help with xmonad configuration, visit : Xmonad docs

warning

When you change the theme, things like border colors, border width, in xmonad.hs file gets overwritten by the theme script.

This is applicable only in Xmonad Premium as themes are only available in it. On regular version, there's only one theme.

Keybindings

Here's a list of some important keybinds you need to know for operating Xmonad easily. If you want to view, modify or add new keybinds, Edit ~/.config/xmonad/xmonad.hs 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 + TOpen theme applet only in premium
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..9,0Switch to respective workspace
super + shift + 1..9,0Send focused client to respective workspace
super + Y/U/ISwitch to physical/Xinerama screens 1, 2, or 3
super + shift + Y/U/IMove client to screen 1, 2, or 3

Window Management

KeysAction
super + CClose focused window
super + ctrl + GToggle all gaps
super + shift + GReset the gaps
super + ctrl + TIncrease the left-hand gap
super + shift + TDecrease the left-hand gap
super + ctrl + YIncrease the top gap
super + shift + YDecrease the top gap
super + ctrl + UIncrease the bottom gap
super + shift + UDecrease the bottom gap
super + ctrl + IIncrease the right-hand gap
super + shift + IDecrease the right-hand gap
super + shift + RResize viewed windows to the correct size
super + alt + MMove focus to the master window
super + shift + MSwap the focused window and the master window
super + FToggle fullscreen
super + SpaceToggle between floating and tiling
super + ctrl + SpaceRotate through the available layout algorithms
super + shift + SpaceReset the layouts on the current workspace to default
super + TabMove focus to the next window
super + Left/JMove focus to the next window
super + Right/KMove focus to the previous window
super + shift + Left/JSwap the focused window with the next window
super + shift + Right/KSwap the focused window with the previous window
super + HShrink the master area
super + ctrl + LeftShrink the master area
super + LExpand the master area
super + ctrl + RightExpand the master area
super + CommaIncrease the number of windows in the master area
super + PeriodDecrease the number of windows in the master area
super + QRecompile and restart xmonad
super + shift + SlashRun xmessage with a summary of the default keybindings

Misc Keys

KeysAction
ctrl + alt + VOpen vim in terminal
ctrl + alt + ROpen ranger in terminal
ctrl + alt + HOpen htop in terminal
ctrl + alt + MOpen ncmpcpp with album art in terminal
ctrl + alt + LTrigger lockscreen
super + PRun colorpicker
super + EscapeRun xkill

Screenshots

Desktop

Here's few screenshots of Xmonad desktop. These'll give you an idea of the experience of Xmonad 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

Themes

There's only one theme available on regular Xmonad.

img

FAQs

How to update my config to new configs?

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

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

For Xmonad Premium, download the updated package from ko-fi (for free) and just install it to update to new configs.

How to change GTK theme, icons and cursor?

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

Net/ThemeName "Rick"
Net/IconThemeName "Zafiro-Red"
Gtk/CursorThemeName "Qogirr-Dark"
How to manage multiple monitors and resolution in Xmonad?

If you use multiple monitors with Xmonad 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