Dwm configuration and installation linux - Debian/Ubuntu 4/4

Categories:  linux,
Labels:  OS, bash, install


Part 1: Preparation

Part 2: Configuration

Part 3: There are a lot of options

Part 4: Installation

Part 4: Installation

a) The generic quick-and-dirty method

This is the method from the README file. It will put dwm into /usr/local/bin which is good for two reasons: that directory is empty by default in Debian, and it is already in your $PATH
The disadvantage of this method is that APT will not be aware of its existence, so you have been warned.
The advantage is that it is, well, quick:

# make clean install

If you plan to tinker with your config.h a bit, each time you just need to run this command from the ~/Build/dwm_6.0 directory, then exit dwm (Alt-Ctrl-q in my case) and ‘startx’ again.

b) The ‘proper’ APT/Debian way

Once you have it set up how you want, you can make a .deb and install it properly.
This is straightforward too; just run this to make the .deb (from in the ~/Build/dwm_6.0 directory):

$ dpkg-buildpackage -us -uc

This will spit out lots of output; the options given mean it shouldn’t prompt you about unsigned files.
When it finishes you should find your .deb in the parent directory, so cd up one level and install like so (as root):

$ cd ..
# dpkg -i dwm*.deb

Done! Now it’s official.

Don’t forget to uninstall the file at /usr/local/bin/dwm (if you used the quick-and-dirty method) like this:

$ cd ~/Build/dwm_6.0
# make uninstall

You might also want to run

# aptitude hold dwm

So your version doesn’t get overwritten by an update if you’re running testing or sid.

You need to make (or alter) the executable file ~/.xinitrc to start dwm
The last line in it should be

    exec [...] dwm

Here’s mine as an example; :


    . ~/.fehbg              # set wallpaper
    unclutter -root &       # hide cursor when unused

    # Turn Super/Windows key into XF86Launch1
    xmodmap -e "keycode 133 = XF86Launch1"

    # Turn CapsLock into Control
    xmodmap -e "clear lock" -e "keycode 66 = Control_R" -e "add Control = Control_R"

    # Show memory use, volume %, battery % and time in status bar
    while xsetroot -name "$(free -m | awk '/cache:/ { print $3"MB" }')  Vol:$(amixer get Master | tail -1 | awk '{ print $5 }' | tr -d '[]')  Batt:$(acpi | awk '{ print $4 }' | tr -d ',')  $(date +%R)"
            sleep 1
        done &

    # Launch system-wide stuff first, then dwm...
    exec ck-launch-session dbus-launch dwm

Don’t forget to make it executable:

# chmod 755 ~/.xinitrc

Then just run

$ startx

To get the whole show started.

You can also extend dwm with patches to add features like new layouts, such as b.stack (horizontal stacking, good for non-widescreens); see http://dwm.suckless.org/patches

Here’s a working example:


Have fun!
Any errors in this howto are mine, and if you point them out I can fix them :)
(Edited many times for clarity and freshness)

Social Profiles

This web accept cryptocoin donations
BTC address, LTC, ETH, DASH, Uphold:
Why donations?