Sunday, August 5, 2007

My X Desktop

OpenBSDI've been using my IBM Thinkpad T42p as a desktop at home a lot more lately (almost exclusively) and it works great! Just about all of the hardware works (dmesg) -- I can't think of any that doesn't. It's a reasonably fast machine, suspend works, audio works, wifi works...

As for my desktop environment, I've started using dwm because it's extremely small, fast and easy to use with just keystrokes. Windows can be assigned tags which are like workspaces in other managers. There are 9 available tags. I usually have a full-screen xterm running screen on my local machine in tag 1, a full screen xterm running ssh to another box running screen in tag 2 (this screen session has mutt and irssi running in it along with other sessions I like to keep active all the time) and a full screen Firefox in tag 3.

My ~/.xinitrc really only has a few customizations (from where I got it: /etc/X11/xinit/xinitrc):

  • I set my background color to steelblue with "xsetroot -solid steelblue"

  • I include some fonts I built through ports (or installed from packages). I used to put these in /etc/X11/xorg.conf, but now I don't even have an /etc/X11/xorg.conf:

    • xset fp+ /usr/local/lib/X11/fonts/freefonts/

    • xset fp+ /usr/local/lib/X11/fonts/mscorefonts/

    • xset fp+ /usr/local/lib/X11/fonts/ghostscript/

  • I comment out things like clock, fvwm and xconsole

  • I use a configuration that is only minorly modified from the original files I got from James Turner:
    if [ -f ${HOME}/.dwm/dwmrc ]; then
    [ -p ${HOME}/.dwm/dwm_status ] || mkfifo ${HOME}/.dwm/dwm_status
    sh ${HOME}/.dwm/dwmrc &
    exec dwm ${HOME}/.dwm/dwm_status

Here is my modified version of Jame's ~/.dwm/dwmrc (used in my .xinitrc above). What James's code allows me to do is have certain information displayed in dwm's status area (top, right by default) like system load and date/time. If you don't use the FIFO approach, when you close X, it'll wait until your script's sleep completes before exiting. Using the fifo allows X to exit immediately. (Thanks, James)

As for dwm, I'm using the stock dwm from packages. I'm very happy with the way it works.


  1. Ah, thanks for this. I was actually looking for something to start dwm with a usable status bar through startx, without gdm or other window managers. Using <> and a named pipe did the trick.

  2. I have since started using scrotwm. It's a new window manager in OpenBSD ports (will be in 4.5) and snapshots. If you like xmonad and/or dwm, you should check it out. Additionally, the status bar thing takes care of itself with:
    bar_action = /home/mike/bin/
    in my ~/.scrotwm.conf

  3. Ohh i love scrotwm!! I find some bugs but marco@ dont have time to fixed! :(