DWM - How to install dwm, dmenu and st

archlinux screenshot using dwm - display window manager

DWM (Dynamic Window Manager) is a minimalist, lightweight and suckless WM (Window Manager).


Dependencies

Before building dwm, dmenu and st, make sure you have the necessary dependencies installed:

$ sudo pacman -S base-devel libx11 libxft libxinerama
$ sudo pacman -S xorg-server xorg-xinit # <- xorg (if it is not yet installed)

Clone, configure and install

1 - Cloning

$ git clone https://git.suckless.org/dwm
$ git clone https://git.suckless.org/dmenu
$ git clone https://git.suckless.org/st

2 - Building

Go to each directory and build!

$ sudo make clean install

3 - Configuring and rebuilding

Edit config.h in each directory (dwm/config.h, dmenu/config.h, st/config.h) and rebuild!

$ vim dwm/config.h
$ sudo make -C dwm/ clean install

Set up startup scripts

~/.bash_profile
.bash_profile execute on bash startup.

[[ -f ~/.bashrc ]] && . ~/.bashrc
startx # <- start Xorg

~/.xinitrc
.xinitrc execute on X server startup.

# Execute all important tasks before executing dwm.
# xwallpaper ~/path/wallpaper.jpg
# setxkbmap YOUR-KEYBOARD-LAYOUT
exec dwm

Optional: Using a Script

Alternatively, you can use a script for setting up everything quickly:

sudo pacman -S base-devel libx11 libxft libxinerama
sudo pacman -S xorg-server xorg-xinit

mkdir ~/suckless
git clone https://git.suckless.org/dwm ~/suckless/dwm
git clone https://git.suckless.org/dmenu ~/suckless/dmenu
git clone https://github.com/LukeSmithxyz/st.git ~/suckless/st # Luke's fork
# git clone https://git.suckless.org/st ~/suckless/st

sudo make -C ~/suckless/dwm clean install
sudo make -C ~/suckless/st clean install
sudo make -C ~/suckless/dmenu clean install

printf "\nstartx" >> ~/.bash_profile
printf "\nexec dwm" >> ~/.xinitrc