Graham's TWM Page!

TWM (Tab Window manager) is the default (i.e. already installed!) windower manager in X (aka X Windows) and deserves some respect as it was one of the first useable WM's to come into wide spread use and an integral part of the X system.

Having tried every single 'Desktop Environment' and 'Window Manager' in the FreeBSD ports tree I settled down with Fluxbox. It has enough eye candy and is fairly easy to use and configure. However, following another 'installathon' - my quest to review yet another recent Linux Distro to see how things are coming on - I realised that most of my time was spent trying to replicate a previous incarnation of my desktop.

Now, this is where alot of Unix guru's will recommend a completely seperate Home partition, but alas I never did get round to doing this, so inevitably I have spent many hours honing some archane dot files and getting things how I liked them. These days even fluxbox has half a dozen config files and at times I have struggled to remember how I acheived certain characteristics of a previous setup...

As I have a strong leaning towards minimalism I recently decided it was time to take TWM for another spin *and* document what I had acheived, as this surely would be the fastest way back to a usable desktop following any more late night distro surfing. I don't really know why deviate from FreeBSD - it has most things I need in a Unix system, and I have identified that I only require about 6 applications on my X desktop :)

OK, so TWM is fairly easy to configure but alot of people, upon seeing the default config, scream 'Ugh, thats awful!' and head off to the ports tree or their distro sources in search of the latest and greatest uber desktop environment.

There are some hardcore TWM fans and mimimalists however who stick around and get to liking the basic feel of TWM. Then they start to mod it and create their own custom dekstop. All part of the fun in Unix :)

So, here is my first theme for TWM. I copied it pretty much from a theme for VTWM, another Window Manager by Tom LaStrange, that's also listed on http://xwinman.org

Color
{
BorderColor         "Black"
DefaultBackground   "White"
DefaultForeground   "Black"

TitleBackground     "LightSteelBlue"
TitleForeground     "White"

MenuTitleBackground "White"
MenuTitleForeground "Black"

MenuBackground      "LightSteelBlue"
MenuForeground      "Black"

MenuShadowColor     "Black"
MenuBorderColor     "Black"
}
# Background: xsetroot -solid "slategrey4"

The main detail of a theme in TWM is the color section of your .twmrc - I'm going to post my themes on this page (with a small screen grab) so you and I can just cut and paste them should we ever get bored of our current theme (this happens quite often here!) There are other settings within the .twmrc configuration file that will effect the way TWM looks. I will list those after my themes, hopefully with comments that explain each section.

The casual observer may have noticed my 'Settings' menu and a list of 'Virtual Desktops'. I am not using VTWM here, no! I have added 'VDesk' - a Virtual Desktop Manager that works fine with most mimimal window managers. You can get VDesk here http://offog.org/code/vdesk.html

Color
{
BorderColor         "Black"
DefaultBackground   "#CDD2BD"
DefaultForeground   "Black"

TitleBackground     "#9CAAC5"
TitleForeground     "White"

MenuTitleBackground "#9CAAC5"
MenuTitleForeground "Black"

MenuBackground      "#B4B6B4"
MenuForeground      "Black"

MenuShadowColor     "Black"
MenuBorderColor     "Black"
}
# xv ~/.twm/walls/qnx.png -root -quit -maxpect

This theme was based on a Fluxbox theme that mimmicked a QNX desktop theme. Its the closest I could get TWM to the original. Bug? If you set 'MenuTitleForeground' to say white, the frame at the bottom of the menu title also takes on this attribute? This probably isnt what you want.

Color
{
BorderColor         "Black"
DefaultBackground   "#ACAAAD"
DefaultForeground   "Black"

TitleBackground     "#3072EC"
TitleForeground     "White"

MenuTitleBackground "#3072EC"
MenuTitleForeground "White"

MenuBackground      "#ACAAAD"
MenuForeground      "#322E2D"

MenuShadowColor     "#322E2D"
MenuBorderColor     "Black"
}
# xv ~/.twm/walls/stones.gif -root -quit

A grey / blue theme with a stone background. The idea came from another Fluxbox theme on Freshmeat In fact most of the theme ideas have come from similar Fluxbox themes I have used in the past.

Color
{
BorderColor         "#AEB2C5"
DefaultBackground   "#AEB2C5"
DefaultForeground   "Black"

TitleBackground     "#B44D7A"
TitleForeground     "White"

MenuTitleBackground "#B44D7A"
MenuTitleForeground "White"

MenuBackground      "#AEB2C5"
MenuForeground      "#322E2D"

MenuShadowColor     "#322E2D"
MenuBorderColor     "White"
}
# xv ~/.twm/walls/solaris.gif -root -quit

A colourfull theme with an OS logo background from a famous computer company!

Color
{
BorderColor         "#303639"
DefaultBackground   "White"
DefaultForeground   "Black"

TitleBackground     "Firebrick"
TitleForeground     "White"

MenuTitleBackground "Firebrick"
MenuTitleForeground "White"

MenuBackground      "#FFFFFF"
MenuForeground      "#303639"

MenuShadowColor     "#303639"
MenuBorderColor     "#303639"
}
# xv ~/.twm/walls/reduxbg.jpg -root -quit

A red / blue theme based on the Network Redux website colours!

Color
{
BorderColor         "#4E4E4E"
DefaultBackground   "#D6D6D6"
DefaultForeground   "#000000"

TitleBackground     "#4E4E4E"
TitleForeground     "White"

MenuTitleBackground "#4E4E4E"
MenuTitleForeground "White"

MenuBackground      "#D6D6D6"
MenuForeground      "#4E4E4E"

MenuShadowColor     "#303639"
MenuBorderColor     "#000000"
}
# xv ~/.twm/walls/ptile.jpg -root -quit

A subtle theme based on one of the 'Satellite' Fluxbox themes on Freshmeat.

Color
{
BorderColor         "#000000"
DefaultBackground   "#E6E6E6"
DefaultForeground   "#000000"

TitleBackground     "#45152F"
TitleForeground     "White"

MenuTitleBackground "#45152F"
MenuTitleForeground "White"

MenuBackground      "#E6E6E6"
MenuForeground      "#363636"

MenuShadowColor     "#363636"
MenuBorderColor     "#000000"
}
# xv ~/.twm/walls/greyrock.gif -root -quit

A theme based on RiscOS colours - although I have never actually seen it, only other themes based on it!

Color
{
BorderColor         "#000000"
DefaultBackground   "#E6E6E6"
DefaultForeground   "#000000"

TitleBackground     "#5E7297"
TitleForeground     "White"

MenuTitleBackground "#443F5F"
MenuTitleForeground "White"

MenuBackground      "#C0C0C0"
MenuForeground      "#414D5B"

MenuShadowColor     "#000000"
MenuBorderColor     "#000000"
}
# xv ~/.twm/walls/clothe03.gif -root -quit

A nice blue / purple theme with a demin background. Tiles for the themes can be found in my tile repository.

Color
{
BorderColor         "#000000"
DefaultBackground   "#C0C1B1"
DefaultForeground   "#595E3E"

TitleBackground     "#595E3E"
TitleForeground     "White"

MenuTitleBackground "#595E3E"
MenuTitleForeground "White"

MenuBackground      "#C0C1B1"
MenuForeground      "#595E3E"

MenuShadowColor     "#363636"
MenuBorderColor     "#000000"
}
# xv ~/.twm/walls/greenstone.jpg -root -quit

An olive theme with greenstone background.

Color
{
BorderColor         "#000000"
DefaultBackground   "#D1D1D1"
DefaultForeground   "#7F7F7F"

TitleBackground     "#005B5B"
TitleForeground     "White"

MenuTitleBackground "#005B5B"
MenuTitleForeground "White"

MenuBackground      "#D1D1D1"
MenuForeground      "#7F7F7F"

MenuShadowColor     "#363636"
MenuBorderColor     "#000000"
}
# xv ~/.twm/walls/egypt.gif -root -quit

A theme based on the colours from the Slashdot website with a hieroglyphic background.

Ok, thats enough themeing for now! (I'll never get any 'real work' done at this rate:) There are other setting within your .twmrc you might want to change. I tend to group together and comment settings so thats it easier to identify what does what when you come back weeks later to change something. Other items effecting the 'Look and Feel' are as follows :-

# Settings effecting window borders etc ------------------------------------------

BorderWidth 1 			# Number of pixels for border around entire window
FramePadding 1 			# Number of pixels between titlebar buttons & frame
TitleButtonBorderWidth 0 	# Number of pixels for button border
TitlePadding 2 			# Number of pixels around title buttons
ButtonIndent 0 			# Larger seems to squash buttons together
MenuBorderWidth 1 		# Number of pixels for menu border
NoMenuShadows 			# No shadow behind the menu

# Title bar buttons

IconDirectory "/home/admin/.twm/icons" # Directory for non default icons
LeftTitleButton "resize.xbm"=f.resize
RightTitleButton "minimize.xbm"=f.iconify
RightTitleButton "maximize.xbm"=f.fullzoom
RightTitleButton "close.xbm"=f.delete

# -------------------------------------------------------------------------------

The 'UI' in TWM is very customisable. Alot or people who prefer keyboard commands over mouse input have specific configs to get TWM to behave how they like. I have to admit I am a lazy mouse user and you might see in my 'UI config' I have tried to emulate the actions of other WM's. The comments should explain each setting!

# Mouse settings and Window beahviours ------------------------------------------
#
# Button1=left, Button2=middle, Button3=right, m=alt, c=ctrl, s=shift

# The root window actions i.e. clicking on the backgound
Button1 = : root : f.menu "RootMenu"
Button2 = : root : f.menu "System"
Button3 = : root : f.menu "TwmWindows"

# Left click the window title to lower / raise + gain focus or move
Movedelta 1
Button1=	:title: f.function "raise-lower-move"
Function "raise-lower-move" { f.move f.raiselower }

# Middle click the window title for options for individual windows
Button2 = : title|frame : f.menu "WindowMenu"

# Right click window title to resize the window by mousing beyond frame
Button3 = : title|frame : f.resize

# Hold alt key and left click to move entire window
Button1 = m : window : f.move

# Hold shift key and right click / move to resize. Best near edges than centre.
Button3 = s : window : f.resize

# Hold Alt and Tab cycles through windows bringing up focus
Function "winup" { f.circleup }
"Tab" = m : root|window|frame|title : f.function "winup"

# Hold Alt plus left click window title to maximize window vertically
Button1 = m : title|frame : f.zoom

# Hold Alt plus right click window title to maximize window horizontally
Button3 = m : title|frame : f.horizoom

DefaultFunction f.nop
# -------------------------------------------------------------------------------

I'll link my full, rather messy .twmrc along with my custom icons later down the page. Here are some useful links relating to TWM. As an aside, any TWM fans stumbling upon this page that have any interesting mods or tips for any aspect of TWM please do get in touch, I would love to hear from you.

http://www.cl.cam.ac.uk/cgi-bin/manpage?1+twm - The TWM manual page in HTML format
http://en.wikipedia.org/wiki/Tom's_Window_Manager - Wikipedia entry for TWM showing the deafult 'theme'
http://xwinman.org/vtwm.php - The TWM page on the famous Xwinman web site
http://www.lastrange.com/work/ - Tom LaStrange Website, the revered author of TWM (Cool surname:)
http://www.linkedin.com/in/tlastrange - Tom's page on LinkedIn, a proffesional business network site.
twm.pdf - An overview of TWM by Tom LaStrange - 10 page pdf document from 1989
http://kiosk.mozdev.org/twm-kiosk.html - how to run TWM in 'Kisok Mode' handy for Internet Cafe's etc

I'll add more links when I come across them. If you have your own page on TWM please send me a link. In the meantime I am posting my .xinitrc to remind me how I start X with TWM! That's all you need, an .xinitrc and a .twmrc

# Sample .xinitrc ---------------------------------------------------------------
#
# Sets mouse cursor type unless you like the black X
xsetroot -cursor_name left_ptr
# Sets my background wallpaper
xv /usr/home/admin/.twm/walls/bg.gif -root -quit
# Sets the mouse behaviour / speed etc
xset m 30/10 4
# Sets the keyboard repeat rate
xset r rate 200 40
# Switch off annoying default beeps
xset -b
# Switch off X screen blanking and dpms blanking
xset s off
xset -dpms
#  Switch on chosen screensaver
xautolock -time 5 -locker "xlock -enablesaver -nolock -mode molecule" &
# Launch VDesk for Virtual Desktops in TWM
vdesk &
# Finally launch TWM (The Window Manager!)
exec twm
# -------------------------------------------------------------------------------

Here are the links to my window icons, wallpapers and a whole load of other .twmrc files I found in various places on the internet. I'm still working on tidying up my own .twmrc but will post that when finished.

Icons - The icon files I used, as seen on my themes window title buttons
Tiles - Various tiles and seamless backgrounds I used in the themes
Walls - Various wallpapers have I used in the past inc current theme
Configs - TWM config files I colllected around the internet

And at last, my current screenshot! Click to enlarge (1280x1024)


20-04-08 - In this shot :- Conky, Xcalc, Xterm, Xfw, Eterm


12/04/08 - The elements making up this shot are :- TWM (of course!), Conky (the infobar at the top) MP3Blaster CenterIM and a transparent Eterm