7.9. X11R5 Window Manager Customisation   

A similar file exists for twm - the X11R5 distributed Window Manager - ".twmrc". The following frames show some of the control structure for the file. Firstly the overall control:

    ## TWM control file

# Version: 2.52
# Date: 30/6/92
AutoRelativeResize # Don't require resize to cross border to start
BorderWidth 2 # Width of top level windows created by TWM
ClientBorderWidth # Use the application border width on frame
ConstrainedMoveTime 0 # turn off horizontal/vertical only moving
#DecorateTransients # Put titlebars on transients
DontMoveOff # Prevent windows leaving our screen
DontSqueezeTitle
NoCaseSensitive # Turn off case-sensitivity in icon sorting
NoGrabServer # Don't grab server during menus, etc.
NoRaiseOnMove # Allow moving under other windows
NoRaiseOnResize # Allow resizing under other windows
NoSaveUnders # Faster to just repaint than save
NoTitleFocus # Avoid keystrokes in wrong window due to lag
RestartPreviousState # Re-iconify iconified things on startup
UsePPosition "on" # Program-specified size hints accepted
Zoom 128
IconFont "lucidasanstypewriter-18"
IconManagerFont "lucidasanstypewriter-18"
MenuFont "lucidasanstypewriter-14"
ResizeFont "lucidasanstypewriter-18"
TitleFont "lucidasanstypewriter-16"

Now key and button binding with associated functions which can be invoked. (For example Button1 = m : window|icon : f.function "move-or-lower" means when button 1 is clicked and the Meta key is also pressed in a window or an icon then invoke function "move-or-lower" defined previously).

    #

# Define some useful functions for motion-based actions.
#
DefaultFunction f.nop
MoveDelta 3
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 }
#
# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish
#
Button1 = : root : f.menu "hosts"
Button2 = : root : f.menu "apps"
Button3 = : root : f.menu "defops"
Button1 = m : window|icon : f.function "move-or-lower"
Button2 = m : window|icon : f.iconify
Button3 = m : window|icon : f.function "move-or-raise"
Button1 = : title : f.function "move-or-raise"
Button2 = : title : f.raiselower
Button3 = : title : f.menu "windowmenu"
Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify
Button3 = : icon : f.menu "iconmenu"
Button1 = : iconmgr : f.iconify
# SUN4 "Stop" key
"L1" = : icon | iconmgr | window : f.destroy
"L1" = s : icon | window : f.delete
"L1" = c : all : f.restart
"L1" = m : all : f.quit
"Help" = : all : f.identifY

Then application specific control of events:

    NoTitle

{
"xclock"
"xbiff"
"Xman"
}
WindowRing
{
"XTerm"
"Xarchie"
"ups"
}
AutoRaise
{
"XTerm"
"Xarchie"
"ups"
"xv"
}
Cursors
{
Button "top_left_arrow"
Destroy "pirate"
Icon "top_left_arrow"
IconMgr "top_left_arrow"
Frame "top_left_arrow"
Menu "top_left_arrow"
Move "top_left_arrow"
Resize "top_left_arrow"
Select "crosshair"
Title "top_left_arrow"
Wait "watch"
}
Monochrome
{
BorderColor "white"
DefaultBackground "black"
DefaultForeground "white"
MenuTitleBackground "black"
MenuTitleForeground "white"
MenuBackground "black"
MenuForeground "white"
MenuShadowColor "white"
IconBackground "black"
IconForeground "white"
IconBorderColor "white"
IconManagerBackground "black"
IconManagerForeground "white"
IconManagerHighlight "white"
}
Color
{
BorderColor "slategrey"
DefaultBackground "maroon"
DefaultForeground "gray85"
TitleBackground "maroon"
TitleForeground "gray85"
MenuBackground "maroon"
MenuForeground "gray85"
MenuTitleBackground "gray70"
MenuTitleForeground "maroon"
IconBackground "maroon"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "maroon"
IconManagerForeground "gray85"
}
#IconManagerGeometry "236x1-0+0"
IconRegion "240x240-0+0" NORTH WEST 80 80
IconRegion "120x160-0+240" NORTH EAST 80 80
UnknownIcon "xlogo32"
Icons
{
"XTerm" "terminal"
}

And lastly the menus that can be invoked:

    menu "iconmenu"

{
"Icon" f.title
"Open" f.iconify
"Raise/Lower" f.raiselower
"Refresh" f.winrefresh
"Quit" f.delete
"Kill program!" f.destroy
}
menu "sunhosts"
{
"SUN's" f.title
"abel" f.exec "xterm -title abel -e rlogin abel &"
"cain" f.exec "xterm -title cain -e rlogin cain &"
"" f.nop
:
"tutte" f.exec "xterm -title tutte -e rlogin tutte &"
}
menu "indigohosts"
{
"Indigo's" f.title
"lillee" f.exec "xterm -title lillee -e rlogin lillee &"
"marsh" f.exec "xterm -title marsh -e rlogin marsh &"
}
:
menu "hosts"
{
"Hosts" f.title
"SUN's" f.menu "sunhosts"
"Indigo's" f.menu "indigohosts"
"SG's" f.menu "sgihosts"
"DECstation's" f.menu "dechosts"
}
menu "windowmenu"
{
"Window" f.title
"Iconify" f.iconify
"Raise/Lower" f.raiselower
"Refresh" f.winrefresh
"Resize" f.resize
"Quit" f.delete
"Kill Window!" f.destroy
}
menu "Applications"
{
"Applications" f.title
"Calculator" f.exec "xcalc &"
"Calendar" f.exec "xcalendar &"
"Font list" f.exec "xfontsel &"
"Image viewer" f.exec "xv &"
"Mail reader" f.exec "xmail &"
"Manual pages" f.exec "xman &"
}
menu "winops"
{
"Windows" f.title
"Iconify" f.iconify
"Move" f.move
"Resize" f.resize
"Raise" f.raise
"Lower" f.lower
"Kill" f.destroy
"Delete" f.delete
}
menu "iconmgr"
{
"Icon Manager" f.title
"Show" f.showiconmgr
"Hide" f.hideiconmgr
}
menu "defops"
{
"Twm" f.title
"Windows" f.menu "winops"
"Icon Manager" f.menu "iconmgr"
"" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"" f.nop
"Refresh" f.refresh
"" f.nop
"Version" f.version
"Restart" f.restart
"Exit" f.quit
}