Installing dwm ubuntu 10.04

One of the reason for posting this is because the documentation about dwm on ubuntu is fairly rubbish. Note that there is documentation out there (for example here), though it only takes you on your first little step and leave you all on your lonesome. (Boo woo! Whatever, get over it.) Here is a picture from one of the installation guides.ImageNow there are a few problems with this picture.

1) No system tray, which some applications require.

2) The dwm version in the top right corner. (We’re going to replace that with a clock).

3) The configuration still uses the default alt key. This poses a problem with many applications such as firefox, irssi, chrome … etc.

4) No gaplessgrid patch (Personal favorite).

5) No auto-start configuration. Hence you have to manually turn on the internet every time you start.

The aim of this post is to answer these problems, as my memory is not the “may west” acting as a set of notes for myself also.

Installation guide:

1. install the dependencies

sudo apt-get install trayer build-essential libx11-dev libxinerama-dev sharutils suckless-tools

2. Download the lastest version which at the time of this post is 6.0. Then unpack it and move into that directory.

cd ~/

wget http://dl.suckless.org/dwm/dwm-6.0.tar.gz

tar xvzf dwm-6.0.tar.gz cd dwm-6.0/

cd ~/dwm-6.0

3.  Download the gaplessgrid patch

wget http://dwm.suckless.org/patches/gaplessgrid.c

wget http://dwm.suckless.org/patches/historical/dwm-5.2-gaplessgrid.diff

4. Replace the config.def.h text with this. Changing the alt key to the windows key, and preparing the gapless grid patch.

http://pastebin.com/rRMrUEpb

5. Install the patch with this command

patch -p1 <  dwm-5.2-gaplessgrid.diff

6. Install dwm

sudo make clean install

7. Finally configuring the autostart. Replace vim  with whatever text editor you use.

vim ~/.xsession

8. Paste the following into this file, taking care of the clock, the system tray and the internet.

http://pastebin.com/ZkjL8bb4

9. Set up gdm to auto start that file.

sudo vim /usr/share/xsessions/dwm.desktop

10. And put the following into it.

[Desktop Entry]

Encoding=UTF-8

Name=Dwm Comment=Dynamic window manager

Exec=/etc/X11/Xsession

Icon=dwm

Type=XSession

11. Log out and log in to dwm.

WIN + p = run

WIN + SHIFT + ENTER = gnome-terminal

WIN + g = grid WIN + m = Maxiumize

WIN + t = Tile WIN + f = No layout

WIN + 1, 2, … , 9 = Which screens.

Note all the alt key-bindings have been changed to the window key. Now you should have a clock in the top right corner, a tray and nm-applet should be working. As you may have noticed. To load applications or commands at start-up,  put them in the ~/.xsession file before exec dwm. If you want a background wallpaper.

sudo apt-get install feh

and use the following command in ~/.xsession file before the exec dwm command.

feh –bg-scale ~/Path/to/Wallpaper.jpg

Hope this helps someone, enjoy!

Here is a screenshot with this background

http://www.google.ie/imgres?q=bsd+wallpaper&hl=en&client=ubuntu&hs=Eyb&sa=X&channel=cs&biw=1358&bih=595&tbm=isch&prmd=imvns&tbnid=dUFFMBBgyg3rHM:&imgrefurl=http://www.monky.ro/wallpapers&docid=GxYBzJmYPSC_YM&imgurl=http://www.monky.ro/wp-content/gallery/wallpapers/Wallpaper_BSD_013_TechnoDream.jpg&w=1024&h=768&ei=W_vST5vQII61hAfy48njAw&zoom=1&iact=rc&dur=639&sig=110938351930454254207&page=3&tbnh=129&tbnw=176&start=42&ndsp=24&ved=1t:429,r:13,s:42,i:246&tx=69&ty=94

Advertisements