00:51 August 10, 2012


I tend to actively develop working habits and environments that play with my natural inclinations and provisional needs. So my user interface is the result of years of trying different window managers, saved configurations, and developing scripts. Outside of giving them a Firefox browser window, most people look at my display and have no idea what, if anything, they can do with it. I've wanted to write for awhile about what all goes into it and why in hopes of giving some ideas about what can be done with e.g. X and a few scripts or at least explain why I like my system. But there are a lot of pieces so it may be a bit long.

It all starts with fluxbox . A big shout out to fluxbox: it mostly does what I want out of the box. I used to actively try a bunch of different window managers, but fluxbox has been my favorite for about a decade now. It is keyboard-friendly but still is usable with a mouse. It has text-based configuration , which is easy to mirror across computers, and has multiple desktops. I currently keep six: one with Firefox and Thunderbird, one with four terminals, one with a text editor (emacs), and three of "open usage". I try to avoid overlapping windows except Firefox and Thunderbird. Its very quick to navigate between windows. For mouse-usage, I consider focus-follows-cursor a must (and an old UNIX tradition).

While I use the mouse plenty, I'm more keyboard-driven, so hot keys are a must. Fluxbox has excellent support for hotkeys which I take full advantage of. I have keys for a bunch of window controls and then a series of programs launched with Ctrl + Alt + letter , such as Ctrl+Alt+f for launching Firefox or Ctrl+Alt+t for launching a terminal. I even have a hotkey, Ctrl + Alt + h for launching help on the hotkeys. I did this mostly in case someone wanted help on how to use my computer, but that hasn't actually happened.

One program that changed my operating idiom was xclip which allows for manipulation of what's on the clipboard through shell invocation. I take advantage of this together with other scripts I've written to transform data that I select with the cursor. A common pattern is:

xclip -o | <program> | xclip -i

This runs what is on the clipboard through the program and puts its output back on the clipboard (also, thankfully, fluxbox evaluates hotkey command in a shell environment, so I can use my fancy pipes like this). One example is my pastebin program, which uses this pattern on my copy of pbmoz.py . I select text, press Ctrl+Alt+p, and the URL of the created pastebin is put back on my clipboard that I can then share with Shift+Ins. I try to keep hotkeys for tasks that I do a lot that work better in a windowing environment than from the command line.

The command that I have tied to Ctrl+Alt+s is smartopen . smartopen takes text and goes through a series of handlers. If the handler matches the text, it will open a URL appropriate to the text. For instance, the text:

2 Harrison St.
San Francisco, CA  94105

would open in google maps. I have handlers for bugzilla, google maps, wikipedia, ..., and defaulting to a google search.

While I mostly work from Firefox, hotkeys, and the command line, it is nice to have a menu to launch applications. One thing fluxbox doesn't have that I wanted is dynamic menus. I like to manage my menu through (again) a human-editable config file so I can mirror it between machines, but prefer that only menu items that actually have the programs installed on the machine displayed. While fluxbox doesn't support this directly, you can include a file which you can generate however you like, as pointed out in this helpful article: http://darkshed.net/article/dynamic-menus-in-fluxbox . There also needs to be a piece that refreshes this file. I put this in .bashrc so that it will happen each time a terminal launches (or I can sync it manually). This is a bit weird, as this event has nothing to do with whether a program is installed or not, but without a watcher service that wakes up and decides if the menu needs regeneration, I know of no good way to do this.

I have a source document, http://k0s.org/programs.html , that lists what all I want in the menu. I then have a script, http://k0s.org/hg/config/file/tip/python/html2flux.py , which translates the HTML to fluxbox's format. For good measure I added a fluxbox menu item to edit its menu sources. I could add more dynamic items. I have thought that a menu might be a good place to read e.g. RSS.

I have thought (and continue to think) about using pywm or something similar to have fully dynamic behaviour and in a language I am comfortable with. So far I haven't explored that much.

As far as decorations, I have a toolbar that I mostly ignore except for the clock and wireless icon, some sort of power monitor (I currently use wmacpi since it seems gnome-power-manager no longer works in fluxbox). I have transparent widgets and wallpaper which is either my art (for home computers) or Firefox art (for Mozilla computers), and that's mostly it. Sometimes I run gkrellm. All else is application.

I hope this sheds some light on how and why my UI is the way that it is. It is somewhat messy loosely-integrated system grown out of experimentation, necessity, and practicality. It is certainly not "the way all computers should work", but (IMHO) gives a sharp contrast to the conventional wisdom of e.g. GNOME, Apple, and Microsoft, (amongst others), whose interfaces I find extremely cumbersome. Describing this all in text is also cumbersome compared to the reality of working on things, but I hope this at least lends some sort of understanding to how I work.