Skip to main content

DWM

DWM is a dynamic window manager for Xorg. It manages windows in tiled, stacked, and full-screen layouts, as well as many others with the help of optional patches. Layouts can be applied dynamically, optimizing the environment for the application in use and the task being performed. dwm is extremely lightweight and fast, written in C and with a stated design goal of remaining under 2000 source lines of code. It provides multihead support for xrandr and Xinerama.

img

Installation

Once you finish installing Archcraft, DWM 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 DWM :

$ sudo pacman -Sy archcraft-dwm

Configuration

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

/opt
└── dwm-source : dwm source code
└── config.def.h : dwm config file
/usr
└── share
└── archcraft
└── dwm
├── alacritty : terminal config
   ├── scripts : scripts used for dwm
   ├── theme : desktop theme (polybar, rofi configs)
├── dunstrc : dunst config for notifications
├── picom.conf : compositor config
└── xsettingsd : gtk themes, icons and fonts config file

Terminal

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

/usr/share/archcraft/dwm/alacritty/alacritty.toml : Main configuration file
/usr/share/archcraft/dwm/alacritty/colors.toml : Colors configurations
/usr/share/archcraft/dwm/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 DWM. In DWM window manager, dunst is launched with an alternative config file, which is /usr/share/archcraft/dwm/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 DWM. If you want to change the wallpaper, Edit /usr/share/archcraft/dwm/scripts/dwm_autostart script and add the path to your wallpaper :

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

Statusbar

xsetroot is used to generate the elements on statusbar in Archcraft's DWM window manager.

Edit /usr/share/archcraft/dwm/scripts/dwm_bar script to add/remove/modify the statusbar elements.

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 DWM can be found it /usr/share/archcraft/dwm/scripts directory. These are the following scripts that uses rofi to provide the launchers and applets :

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_layouts : applet to change the layouts
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 DWM /usr/share/archcraft/dwm/theme

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

Compositor

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

/opt/dwm-source/config.def.h is the main configuration file of DWM. If you need to change anything or perhaps you want to add/remove/change keybindings, Edit this file and recompile DWM and then install the new binary.

If you need any help with DWM configuration and customisation, visit : suckless.org

Keybindings

Here's a list of some important keybinds you need to know for operating DWM easily. If you want to view, modify or add new keybinds, Edit /opt/dwm-source/config.def.h file.

Applications

KeysAction
super + ReturnOpen terminal (st)
super + ctrl + ReturnOpen terminal (alacritty)
super + shift + ReturnOpen floating terminal (alacritty)
super + alt + ReturnOpen fullscreen terminal (alacritty)
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
XF86MonBrightnessUpIncrease display brightness
XF86MonBrightnessDownDecrease display brightness

Window Management

KeysAction
super + 1..9Switch to respective tag
super + CClose focued window
super + shift + EqualIncrease border width
super + shift + MinusDecrease border width
super + shift + BackSpaceRestore default border width
super + shift + Bracket_LeftIncrease gaps
super + shift + Bracket_RightDecrease gaps
super + shift + BackslashRestore default gaps
super + shift + GToggle gaps
super + shift + IIncrease inner gaps
super + shift + ctrl + IDecrease inner gaps
super + ctrl + OIncrease outer gaps
super + shift + ctrl + ODecrease outer gaps
super + J/KCycle window
super + shift + J/KSwitch master
super + Left/RightCycle window
super + shift + Left/RightSwitch master
super + IIncrease master vertically
super + UDecrease master horizontally
super + H/LShrink left/right
super + Left/RightShrink left/right
super + shift + BToggle bar
super + TabSwitch to master
alt + TabSwitch to last tag
super + DHide window
super + shift + DRestore window

Layouts

KeysAction
alt + ctrl + SpaceRun rofi layouts applet
super + ctrl + Comma/PeriodCycle layouts
super + shift + SpaceToggle floating
super + FToggle fullscreen
super + SpaceSet last layout
super + TSet Tile layout
super + GSet Grid layout
super + shift + MSet Monocle layout
super + shift + SSet Spiral layout
super + shift + TSet Stack layout
super + shift + CSet Centered-Master layout
super + shift + XSet Tatami layout

Window Manager

KeysAction
super + shift + RRestart dwm
super + ctrl + QQuit dwm

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 DWM desktop. These'll give you an idea of the experience of DWM 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
Desktop 17Desktop 18Desktop 19Desktop 20
imgimgimgimg

FAQs

How to change GTK theme, icons and cursor?

To change GTK theme, icons and cursor in DWM session, Edit /usr/share/archcraft/dwm/xsettingsd file and restart DWM to apply the changes.

Net/ThemeName "Arc-Dark"
Net/IconThemeName "Zafiro-Blue"
Gtk/CursorThemeName "Qogirr"
How to manage multiple monitors and resolution in dwm?

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