dwm notes

It’s funny how the dislike one develops as a novice user towards severe minimalism and its intimidating terminal interface turns a corner. It has certainly been the case with me. I mean, as an end user of Domain/OS back in 1996, I’m no stranger to window managers. I had a job to do, and I was given these Apollo systems to build models and carry out structural analyses on and I did. It’s only when ubuntu began shipping a user-friendly system around 2004-5 was when I began warming up. If I was offered a window manager as a UI instead of Gnome 2.x, then I’d have flinched and said no.

2007 was the year of linux on desktop, but since then the interfaces have been going downhill. My Atom-powered, and generally fine, tiny desktop started feeling out of breath with the new xubuntu, forcing me to look for a simpler interface without swapping its guts. So I switched to ubuntu 16.x and chose dwm — window manager with a pedigree, as my primary interface.

A couple of weekends ago I’d edit header files and compile C code just to get my customised version of dwm and other suckless tools running. Here’s that routine.

Installation

  1. Install ubuntu (16.04.1 as of this post) as usual ([a] download the iso, [b] make a bootable usb stick, [c] boot from the usb, and install it on hard drive).
  2. Install a few libraries to help compile suckless-tools:

    sudo apt-get install suckless-tools libx11-dev libxft-dev libxinerama-dev
    
  3. To download suckless tools, get git first:

    sudo apt-get install git-core
    
  4. Download suckless tools (dwm – dynamic window manager, dmenu, st – simple terminal, surf – web browser):

    cd Downloads
    git clone http://git.suckless.org/dwm
    git clone http://git.suckless.org/dmenu
    git clone http://git.suckless.org/st
    git clone http://git.suckless.org/surf
    
  5. Compile each tool within its downloaded folder:

    cd ~/Downloads/dwm
    make && sudo make install
    cd ~/Downloads/dmenu
    make && sudo make install
    cd ~/Downloads/st
    make && sudo make install
    cd ~/Downloads/surf
    make && sudo make install
    
  6. Logout, and at the login drop down window (click on ubuntu icon to reveal the dropdown), select dwm.

  7. Optional: Custom font setting for dwm (edit config.h and recompile with make && sudo make install):

    static const char *fonts[] = { "Ubuntu Mono:size=13" };
    static const char dmenufont[] = "Ubuntu Mono:size=13";
    
  8. Optional: Custom font setting for st (edit config.h and recompile with make && sudo make install):

    static char font[] = "Ubuntu Mono:pixelsize=16:antialias=true:autohint=true";
    
  9. Optional: Set (auto-updating) clock in the status bar by saving this following in .xprofile:

    # Statusbar loop
    while true; do
       xsetroot -name "$( date +"%F %R" )"
       sleep 1m    # Update time every minute
    done &
    
  10. Optional: st has no cut-paste option, so install xclip with sudo apt-get install xclip and set alias xclip="xclip -selection c" in ~/.zshrc, and then use cat somefile | xclip

Useful commands

  1. Alt+P – Access menu
  2. Shift+Alt+Return – New terminal window
  3. Shift+Alt+C – Close window
  4. Shift+Alt+Q – Close session (logout)
  5. surf – Open surf browser, Ctrl+G Access URL bar
  6. Alt+H – Resize tile window on the left hand side
  7. Alt+L – Resize tile window on the right hand side
  8. eog – Image viewer
  9. nautilus --no-desktop – Access file manager

There’s a nice introductory video by Jason Ryan, if you’re not familiar with dwm.