Install and configure xorg and dwm on arch linux


This is a tutorial on how to install and configure dwm on arch linux. Given that dwm runs on X, as most window managers do, there is a guide on how to install Xorg on arch as well. Both, will guide you through step by step in an hopefully easy way.

Installing all packages myself on arch linux I thought i might as well try something new and adventurous. Looking around the web I found a few enthustiac programmers that use tiled window managers. Researching i found that the one for me is dwm.

Main characteristics of dwm are size, it weighs less than 10 MB dependencies included, and possibility of customisation, given that it is written in C and that its code its very readable. Going to the official website of dwm I found this description:

dwm is a dynamic window manager for X. It manages windows in tiled, monocle and floating layouts. Either layout can be applied dynamically, optimising the environment for the application in use and the task performed.

So far it sounds very good! Light, fast, few dependencies. Regarding the customisation bit……every time a change is made you need to recompile and reinstall. It may seem a bit crazy, however, thinking about it:

Ok let me take dwm for a spin.

When installing arch linux, no Xorg is shipped with it so before installing dwm, Xorg has to be installed and configured. Fairly straight forward….

pacman -Sy xorg

Once xorg is downloaded and installed we need to configure it. There are many tools around but the favourite oneĀ  in the arch community is hwd

pacman -S hwd

hwd is a program that automates the production of the xorg.conf file. This configuration file is the most important as it sets the drivers and paths for:

Once hwd is installed we need to create the xorg.conf file with:

hwd -xa

This command will create two xorg.conf files:

The moment of truth

To verify the xorg files we need to run X with a different xorg.conf, to achieve this we need to use the command:

X -config name_of_the_conf_file

So let’s do it!

cd /etc/X11

X -config xorg.conf.vesa

The TWM window manager should start up. To run your card’s specific conf use its xorg file, xorg.conf.ati, xorg.conf.nvidia or xorg.conf.trident (in my case :) ). Once, you are certain of having a working conf file rename it to xorg.conf (eg. mv xorg.conf.vesa xorg.conf) so that when you startx it is automatically loaded.

Xorg is now configured. Let’s install dwm

pacman -S dwm

When done we need to set dwm to startup when we invoke startx instead of TWM, to achieve this we need to edit the file xinitrc so from the home directory:

cd /etc/X11/xinit

vi xinitrc

Here we need to find the line that says:

#Start some nice programs
xclock …
xterm …
xterm …
exec xterm…

Comment the above lines and add:

exec dwm

Now the command startx will start dwm as your window manager.



Send your comment for the article
  1. Nice, it works. Thanks

    Comment by Hendra — 13 April 2012 @ 15:21
  2. I have noticed you don’t monetize your website, don’t waste
    your traffic, you can earn extra bucks every month because you’ve got high quality
    content. If you want to know how to make extra money, search
    for: Mertiso’s tips best adsense alternative

    Comment by LastQuentin — 27 January 2018 @ 02:59
  3. I often visit your page and have noticed that you don’t
    update it often. More frequent updates will give your blog higher rank &
    authority in google. I know that writing articles takes a lot of time, but you can always help
    yourself with miftolo’s tools which will shorten the time
    of creating an article to a few seconds.

    Comment by RomaJuicy — 1 July 2018 @ 15:54
  4. I have noticed you don’t monetize your site, don’t waste your traffic,
    you can earn additional cash every month. You can use the
    best adsense alternative for any type of website (they approve all websites), for more info simply search in gooogle: boorfe’s
    tips monetize your website

    Comment by BestAbbey — 17 August 2018 @ 06:09

Leave a comment