Screen for StumpWM/Xmonad Users - GNU Screen as a window manager

Thu Oct 6, 2011

The first part is exposition. If you're just interested in how to set up Screen as a StumpWM analogue, skip to this heading.

I've been thinking about window management again, for my own purposes and bouncing around between combination of Xmonad, StumpWM, XFCE and GNOME, as well as trying the two tiling managers standalone.

Using XFCE and GNOME standalone really wasn't going to do anything for me, I already knew that. Using the lightweights on theiir own had a few minor annoyances that I tried to fix by running them together.

Out of the box, neither Xmonad nor StumpWM

It's becoming clear that I don't want a regular point-and-click interface by default anymore, except for one or two specialized tasks for which nautilus --no-desktop should suffice.

I also don't really use removable media anymore. Maybe my memory is a bit clouded, but it seems that I used a lot more USB keys, DVDs and CDs back when I was a Windows/OS X user. It's possible that I was just being stupid, but it seemed like the easiest way of sharing data between two different machines1. That flat out doesn't happen anymore. We only have Linux machines in the house now2, so when I want to share data between them, I use scp, or possibly rsync depending on the specific situation. I don't do backups to DVD or CD anymore; I just use hard drives and the only computer that needs to play DVD media is in the livingroom3. I also don't install things from CDs, except for Debian itself.

Finally, connecting to my wireless network isn't automatically handled, and I do still need to do that with my netbook, but I can work around it4. Granted, I could have just memorized how to do it via iwconfig and friends, but this way is simpler from the interface perspective.

Bottom line; I don't need a desktop environment anymore. I'm good with the plain window manager. So it looks like GNOME is coming off my own desktop this weekend and Stump is getting re-instated as the manager of choice. The thing is, I also have a few old machines lying around that chug noticeably under any sort of graphic interface. And it turns out that if I'm willing to ditch Nautilus, and fend for myself in terms of mounting media/connecting to networks, then I can go all the way to terminal.

I've been using GNU Screen as a way of deploying Lisp applications, but looking over the keybindings and man page, it looks like it can serve as a respectable alternative to a tiling window manager.

Screen WM

The default control combination is C-a instead of C-t, and the keys are significantly different, and you can't extend it in Lisp5, but it looks like a fairly simple .screenrc file can turn it into Stump-Lite. Here's a quick breakdown, assuming the default bindings:

In other words, out of the box, you've got the same basic window management shortcuts this way. And if you feel like remembering extra keys, feel free to commit the above to memory. As for me, my .screenrc file is going to look something like

startup_message off

bind S split -v
bind s split
bind R remove
bind ^e screen emacs -nw

On a machine where I plan to use terminal exclusively, I'll also add

escape ^t
bind ^t other

to mirror the StumpWM keys I'm already used to.

Incidentally, that last line in part one is what got me convinced that screen could credibly replace X for my purposes6. It seems like you can wire up arbitrary shell commands and bind them to keypresses7. I left it out, but you can also put regular screen calls in .screenrc like so

resize 60
screen -t lynx lynx
screen -t emacs emacs -nw
screen -t top top

in order to customize your startup routine. I'm sure I could get more complex than that, but it illustrates the point. That snippet starts me off with a horizontal split. The top frame is emacs, the bottom frame is top and lynx is running in the background.

The stuff that I'll be missing this way is

Given how my .stumpwmrc is shaping up, I don't think this'll be a big sacrifice. The thing I think I'll miss most is actually gitk. I'll let you know how it goes.

  1. Whether they were both mine and sitting in my room, or not and lying on a table in the OCAD student lounge.
  2. Split between Debian, Parabola and Ubuntu, in order of descending quantity.
  3. And has a standard GNOME 2 setup out of deference to my wife, who hasn't taken the Computer Nerd prestige class, opting instead to remain a regular nerd.
  4. I've been meaning to do a writeup on that little UI layer I'm slowly using to coat my shell experience. pack and unpack have already left me smiling several times.
  5. :(
  6. Assuming I'm not working at my dual-monitor setup.
  7. Use exec instead of screen if you don't want to start a new window for them.

Creative Commons License

all articles at langnostic are licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License

Reprint, rehost and distribute freely (even for profit), but attribute the work and allow your readers the same freedoms. Here's a license widget you can use.

The menu background image is Jewel Wash, taken from Dan Zen's flickr stream and released under a CC-BY license