dwm
dwm is an extremely fast, small, and dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. This page provides instructions for installing dwm both from binary packages and from source along with dependencies.
Prerequisites
- Internet connectivity, unless the packages have been pre-fetched into a local cache.
- Install appropriate Graphics driver drivers for your hardware. Without graphics drivers, errors are likely to occur when starting your desktop.
- A non-root user account.
- The community repository must be enabled.
- Set up eudev.
- Install and enable D-Bus. Without D-Bus, icons and keyboard shortcuts may be missing.
- Install Xorg
Installation
The dbus-x11 package is needed for the dbus system as it enables Firefox running in dwm to open in a tile.The packages adwaita-icon-theme and font-dejavu are optional, but recommended for a nicer looking firefox. Install them before proceeding:
# apk add dbus-x11 adwaita-icon-theme font-dejavu firefox-esr
Installing binary packages
Alpine Linux provides binary packages for dwm (dynamic window manager), dmenu (dynamic menu) and st (simple terminal). This allows new users to experience dwm quickly without compiling the source code. To install the binary packages, issue the command:
# apk add dwm dmenu st
Proceed to Starting dwm section to start using dwm with default settings. If you are new to dwm, refer to the official dwm tutorial.
To customize dwm, refer Installing from source.
Installing from source
To customize dwm, the source code written in c language must be edited, compiled and installed everytime for the changes to take effect, which usuaully takes less than a minute.
If you have installed the binary packages, remove them first before proceeding: # apk del dwm dmenu st
Install the necessary packages to compile dwm:
# apk add git make gcc g++ libx11-dev libxft-dev libxinerama-dev ncurses libxft-dev
The following instructions downloads the sources for dwm
, dmenu
and st
in /usr/src/suckless, compiles the source(make) and installs the binaries in /usr/local/bin. If you do not want to keep the sources, use /tmp for downloading the sources.
- Create a directory /usr/src/suckless using the command:
# mkdir -p /usr/src/suckless
- Change to the /usr/src/suckless directory:
$ cd /usr/src/suckless
- Download the
dwm
sources:# git clone https://git.suckless.org/dwm
- Once downloaded, go to the dwm directory:
# cd dwm
- To install dwm, issue the command:
# make clean install
- Next, go up one directory level
# cd ..
- Download and install
dmenu
launcher:# git clone https://git.suckless.org/dmenu # cd dmenu # make clean install
- Finally, go up one more directory level:
# cd ..
- Download and install
st
terminal:# git clone https://git.suckless.org/st # cd st # make clean install
Configuration
The configuration of dwm and other suckless tools are done by editing the config.h file. If not already done, complete Installing from source before proceeding.
The make
command will create config.h file from config.def.h. If the file config.h already exists, make
won't overwrite it and instead use it. Based on above instructions, for customizing dwm, edit the file /usr/src/suckless/dwm/config.h.
All changes related to keybindings, colors, fonts, patches, etc. are to be made to the config.h file and (re)compile the source code by issuing the command # make clean install.
Starting dwm
Create or edit ~/.xinitrc with at least the following:
Contents of ~/.xinitrc
To prevent X from attempting to launch dwm
every time your shell is called with the login flag, make launching `startx` conditional by creating or editing .profile as follows:
Contents of ~/.profile
Log out or reboot. dwm will run the next time you log in.
Press Alt+p to launch dmenu
. Type firefox then press enter. Firefox will load and run in tile 9.
See also
- official dwm tutorial
- Alpine Suck Desktop installer for Alpine Linux based on the suckless philosophy
- Gentoo wiki page on dwm
- Archwiki page on dwm
- Raspberry Pi 3 - Browser Client - A guide which omits dwm, but uses similar steps to install firefox in a diskless install on ARM. dwm is not used on the RPI3, due to tmpfs limitations.