Saturday, November 22, 2014

Solarized dwm + debian

This article is a small post-it to get the desktop of my dreams installed on my machine :)

1. Installing and configuring dwm

Installing dwm from the debian repos is easy but, inorder to customize it we need to compile it from source. First, I install the dependencies

sudo apt-get install libc6 libx11-6 libxinerama1 make gcc suckless-tools xfonts-terminus

dwm by default uses the terminus font and I like it too. Now for the fun part

sudo aptitude build-dep dwm

Now we make a directory to put the source code in, and play around :P

mkdir ~/build
cd ~/build/
apt-get source dwm
cd dwm-6./

Next we edit the config.def.h in the directory and save it as config.h

cp config.def.h config.h
vim config.h

I'm only interested in changing the colors and the font used for the time being so in the config.h file I change ::

static const char font[]            = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#cccccc";
static const char normbgcolor[]     = "#cccccc";
static const char normfgcolor[]     = "#000000";
static const char selbordercolor[]  = "#0066ff";
static const char selbgcolor[]      = "#0066ff";
static const char selfgcolor[]      = "#ffffff";

to this ::

static const char font[]            ="-artwiz-snap-normal-*-*-*-*-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#073642";
static const char normbgcolor[]     = "#002B36";
static const char normfgcolor[]     = "#839496";
static const char selbordercolor[]  = "#586E75";
static const char selbgcolor[]      = "#073642";
static const char selfgcolor[]      = "#839496";

Use xfontsel to see what all fonts we can use. I use the snap font from artwiz package. If you use another terminal emulator change the *termcmd[] command to this ::

static const char *termcmd[]  = { "urxvtc", NULL };

I have the urxvt daemon running in the background when I launch dwm, so the urxvtc.

After this is done, save and exit. From the directory issue 

sudo make clean install

That's it. Now Launch dwm form your $HOME/.xinitrc . If you dont have one follow me

cd
vim .xinitrc

It's content should be something like

exec dwm

Give it executable permissions with chmod +x .xinitrc and we're all set with dwm part. 

For the time being my dwm setup is this ::

busy

To get the date and battery status on the dwm statusbar before the exec dwm line in .xinitrc add 

while xsetroot -name "Batt:$(acpi | awk '{ print $4 }' | tr -d ',')  $(date +%R)"

Save the file and we're done.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home