9twm (twm with a “Plan 9” theme)

Pasted below is a .twmrc file I’ve been hacking the past few days. In conjunction with a simple mod to .xinitrc (see below), it is my attempt at making twm impersonate Plan 9 from Bell Labs as much as possible without adding any extra software or widgets other than those native to X. (For example, the .xinitrc lines suggested below use xload in place of stats from Plan 9.)

The final result equals the looks and sensibilities of Plan 9, but with the behavior and functionality of twm. One glaring omission on the aesthetics side is Plan 9’s big fat pointer arrow. Instead, I’ve opted for a skinny little thing (draft_small) that is much closer to the root window cursor in 9wm.

Another omission is the “Hide” function in the menu. As far as I know, twm doesn’t have that trick. (If I’m wrong, then I’m more than happy to stand corrected. I consider myself only an intermediate Unix user, and am still climbing up that learning curve.)

In addition to the .twmrc file below, your .xinitrc file should include the following:

xsetroot -solid gray -cursor_name draft_small
xload -g 300x125+0+0 -fg purple -update 3 &

And of course, the .twmrc file:

# 9twm -- A Plan9/9wm theme for twm by way of mofications to
# .twmrc and .xinitrc.
# Version 1.0
# By James Deagle (james.deagle@yahoo.com)
# This file is public domain.
# "Dilige et quod vis fac." -Augustine of Hippo
# August 31, 2009
# For best results, your .xinit should include the following:
# xsetroot -solid gray -cursor_name draft_small
# xload -g 300x125+0+0 -fg purple -update 3 &
# twm

MenuFont "-misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1"
BorderWidth 3
ButtonIndent 2
MenuBorderWidth 1

BorderColor "cyan"
BorderTileBackground "cyan"
DefaultBackground "green"
DefaultForeground "black"
MenuBackground "white"
MenuBorderColor "green"
MenuForeground "black"
PointerForeground "black"
PointerBackground "white"


# Define some useful functions for motion-based actions.
MoveDelta 1
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }

Button3 = : root : f.menu "window"

Button1 = m : window|icon : f.function "move-or-lower"
Button2 = m : window|icon : f.iconify
Button3 = m : window|icon : f.function "move-or-raise"

menu "window"
"New" f.exec "xterm -g 80x25 &"
"Reshape" f.resize
"Move" f.move
"Delete" f.delete
"Quit" f.quit

Frame "draft_small"
Move "tcross"
Resize "tcross"
Menu "draft_small"
Button "draft_small"
Wait "clock"
Select "dot"
Destroy "dot"

Comments are closed.

FreeBSD News

The FreeBSD Project is pleased to announce its participation in Google's 2018 Summer of Code pr [...]

About the Meltdown and Spectre attacks: FreeBSD was made aware of the problems in late December 2017 [...]

The July to September 2017 Status Report is now available. [...]