Install dwm

The dwm is light weight window manager. It is easy to operate dwm with keyboard. This is useful for people who use Linux with CUI mainly and with GUI rarely. This article will installing and usage of dwm.

1 Install dwm

Install dwm to recently Linux distribution.

1.1 Ubuntu 16.04 / Debian 8

Install dwm with apt.

$ sudo apt install -y dwm

1.2 Fedora 24

Install dwm with dnf.

$ sudo dnf install -y dwm

1.3 CentOS 7

Use Fedora 22 srpm. Running the following script will install dwm.

#!/bin/sh

# Create work directory.
mkdir dwm
cd dwm

# Download archives from Fedora 22 repository.
F=http://archives.fedoraproject.org/pub/archive/fedora
F22=${F}/linux/releases/22
wget ${F22}/Everything/source/SRPMS/d/dwm-6.0-11.fc22.src.rpm
wget ${F22}/Everything/source/SRPMS/d/dmenu-4.5-7.20140425git.fc22.src.rpm
wget ${F22}/Everything/source/SRPMS/t/terminus-fonts-4.39-1.fc22.src.rpm

# Build dependencies.
sudo yum install -y libXft-devel libXinerama-devel fontpackages-devel

# Build packages.
rpmbuild --rebuild dwm-6.0-11.fc22.src.rpm
rpmbuild --rebuild dmenu-4.5-7.20140425git.fc22.src.rpm
rpmbuild --rebuild terminus-fonts-4.39-1.fc22.src.rpm

# Install packages.
sudo yum localinstall -y \
     ~/rpmbuild/RPMS/x86_64/dwm-6.0-11.el7.centos.x86_64.rpm \
     ~/rpmbuild/RPMS/x86_64/dwm-user-6.0-11.el7.centos.x86_64.rpm \
     ~/rpmbuild/RPMS/x86_64/dmenu-4.5-7.20140425git.el7.centos.x86_64.rpm \
     ~/rpmbuild/RPMS/noarch/terminus-fonts-4.39-1.el7.centos.noarch.rpm \
     ~/rpmbuild/RPMS/noarch/terminus-fonts-console-4.39-1.el7.centos.noarch.rpm

2 Usage of dwm

Running dwm is as below.

0001_dwm.png

  • dwm has 1-9th tag which has multiple windows.
  • One window is mapped to one application like terminal and firefox.
  • Windows key will be assigned to Mod1.
  • The application started by dwm is only terminal. Other application will be started by running command on terminal.
  • Switch tile layout On/Off with Mod1 + t / Mod1 + m. Run firefox by running command "firefox" on terminal. And switch tile layout Off. Then the firefox will be full screen.

Shortcut is as below.

Mod1 + Shift + Enter Run new terminal
Mod1 + Shift + q Quit dwm
Mod1 + Shift + [1-9] Move window to 1-9th tag
Mod1 + Shift + c Close window
Mod1 + j Focus next window
Mod1 + k Focus prev window
Mod1 + Shift + 0 Show all window
Mod1 + [1-9] View 1-9th tag
Mod1 + Shift + 1-9 Move focused window to 1-9th tag
Mod1 + t Enable tile layout
Mod1 + m Disable tile layout
Mod1 + i Split window to vertical
Mod1 + d Split window to horizontal