CTWM Configuration Examples Below are two ASCII files that may be used as templated for the CTWM (window manager). At least .xsession should be chown'd 0755.

Here are screenshots produced by the two-file configuration and CTWM. Screenshots

${HOME}/.xsession


This tells which binaries ctwm is to exec; and exactly how: for example using /usr/bin/nice to lessen the load for certain less critical programs.


#!/bin/sh

#
## This is "~/.xsession"; it could as well be named "~/.xintrc"
## Sample customization for ThinkPad.  Season to taste!
#

ctwm &
/usr/X11R6/bin/xrdb -merge "$HOME/.Xresources"
/usr/X11R6/bin/xrdb "$HOME/.Xdefaults"
/usr/X11R6/bin/xrdb "$HOME/.Xnet"
# 
## BATTERY 
#
asapm -position +160+0 &

#
## XLOAD
#
/usr/bin/nice -15 xload -g 155x50+260+0 &


# 
## desktop tools that are window manager independent.
#
/usr/bin/nice -2 /usr/X11R6/bin/rclock -g 95x95-0+0 & 
/usr/bin/nice -9 /usr/X11R6/bin/xosview     -geometry 420x290+3-2   &
sys1xterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g 80x44-0-0  -sb -sl 1024 -n "XSystem I"  -iconic &
/usr/bin/nice -19 xpostit+ -bs 8096 -bg lightskyblue -sb -sv -g 84x53+162+-11 &
/usr/bin/nice -18 tkdesk &
/usr/bin/nice -16 xcpustate  -g 362x20+427+245 &
/usr/bin/nice -16 xsysinfo  -g 362x138+0+300 &

#
## calendars
#
/usr/bin/nice -6 ical -geometry 64x76+62+169 -iconic &
/usr/bin/nice -17 xcalendar -geometry +158+65 &

#
## some misc stuff you can add (or NOT)... .
#

###/usr/bin/nice -5 swisswatch -fg darkred -bg yellow -g 50x50+207+0 &
###/usr/bin/nice -14 knews -nntpServer news.tera.com -iconic -g  875x700 &
###/usr/bin/nice -7 xdaliclock   -geometry 254x58+797+-15 -24 -cycle -font "-*-new century schoolbook-bold-r-*-*-*-500-*-*-*-*-*-*" &
### adding (test) 05jan99
### /usr/bin/nice -18 xautolock -time 10 -corners 00+0 -cornerdelay 5 -cornerredelay 20 -notify 2 -locker "xlock -mode random -allowroot" &



xset r off
scratchxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g 80x44+0-0  -sb -sl 1024 -n "XScratch"  -iconic &
scratchxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g    80x44-0-0 -sb -sl 1024 -n ScratchPad -iconic &
scratchxterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x44-0-0 -sb -sl 1024 -n "XScratchSystem" -iconic &        

#
## some xterm/xterm-with-apps
#

/usr/bin/nice -10 xtermE -n top -g 80x24+0-0 -e top  &
/usr/bin/nice -10 xtermE -n Commands    -geometry 80x30+424+78 -iconic &

newsxterm -n Sadmin -sb -sl 1025 -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g 80x44+0-0 &
newsxterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x47-0-0 -sb -sl 1024 -n XSage -iconic &        

Xtermb -n Cappuccino \
	-fn  -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 \
	-sb -sl 1024 -geometry  80x51+325-0 -iconic &
Xtermb -n Day -fn  -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 \
	-sb -sl 1024 -geometry 80x44-0-0 -iconic &

Xtermb  -geometry 80x45+0-0 \
	-fn  -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 \
	-sb -sl 1024 -iconic -n Sunshine &

xterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x44-0-0 -sb -sl 1024 -n "System Admin" -iconic &        
xterm -n "SysAdmin Beta" -sb -sl 1024 \
	-fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 \
	-g  80x44-0-0 -iconic &
xterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g 80x44+0-25  -sb -sl 1024 -n "Zen"  -iconic &
mailxterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x44+0-0 -sb -sl 1024 -n XReply -iconic &        
mailxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1   -geometry 80x44+0-0  -sb -sl 1024 -n "Dyna"  -iconic &

#
## other admin xterms
#
taoxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1   -geometry 80x45+0-0  -sb -sl 1024 -n "taoAdmin"  -iconic &
taoxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1   -geometry 80x45-0-0  -sb -sl 1024 -n "ethicAdmin"  -iconic &
taoxterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x45-0-0 -sb -sl 1024 -n XTaoSys &        
taoxterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x44-0-0 -sb -sl 1024 -n XEthicSys -iconic &        

newsxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g  80x48-0-0 -sb -sl 1024 -n "XSageAdmin"  -iconic &
progxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1   -geometry 80x42+0-0  -sb -sl 1024 -n Steel &
progxterm  -fn -adobe-courier-bold-r-normal--11-80-100-100-m-60-iso8859-1 -g 80x57+0-0 -sb -sl 1024 -n CoreTen -iconic  &

progxterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x41-0-0 -sb -sl 1024 -n XHack -iconic &        
progxterm -fn -adobe-courier-bold-r-normal--11-80-100-100-m-60-iso8859-1 -g 80x44-5+67 -sb -sl 1024 -n XGuru -iconic  &

xterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g  80x44+45-0 -sb -sl 1024 -n XtraScreen -iconic &
netxterm -fn  -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g    80x41-5-5 -sb -sl 1024 -n Miscellaneous &
netxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g 80x44+0-0 -sb -sl 1024 -n Net -iconic &
Xtermb -fn -adobe-courier-bold-r-normal--11-80-100-100-m-60-iso8859-1 -g 80x60-0+0 -sb -sl 1024 -n Espresso -iconic  &
Xtermb  -fn -adobe-courier-bold-r-normal--11-80-100-100-m-60-iso8859-1 -g 80x57+0-0 -sb -sl 1024 -n Cafe -iconic  &
progxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1   -geometry 80x44-0-0 -sb -sl 1024 -iconic -n Java &
progxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1   -geometry 80x44+326+151   -sb -sl 1024 -iconic -n Coffee &
mailxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g    80x48-0-0 -sb -sl 1024 -n Mail -iconic &
mailxterm -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x46-0-0 -sb -sl 1024 -n XMail &        
Xtermb -fn -adobe-courier-bold-r-normal--14-100-100-100-m-90-iso8859-1 -g 80x44-0-0 -sb -sl 1024 -n XScribe -iconic &        
xterm -geometry 80x44+175-0 -fn 9x15bold -sb -sl 1024 -n "Main DolichoView" -iconic -ls 

#
## AxB -0-0 (anchors xterm in lower right)
## AxB +0-0 (anchors xterm in lower left)
## AxB +Z-0 (anchors xterm "Z" pixels from left at BOTTOM)
#
## AxB +0+0 (anchors in upper left)
## AxB -0+0 (anchors in upper right)
## AxB +Z+0 (anchors xterm "Z" pixels from left at TOP)
#

Of critical note is that to have multiple xterms in different Workspaces, you must create links, symbolic or hard. I.e.:


cd /usr/X11R6/bin;
ln xterm mailxterm;
ln xterm scratchxterm
ln xterm progxterm
...


You might want to turn this into a /bin/sh script and stash it wherever you have your personal *.sh scripts.

There are probably other ways of doing this, but making simple links works.







${HOME}/.ctwmrc



#
## This file is your "~/.ctwmrc".  This goes with the lines in "~/.xsession"
## immediately above.
#


# 
# Default twm configuration file; needs to be kept small to conserve string
# space in systems whose compilers don't handle medium-sized strings.
#
# Sites should tailor this file, providing any extra title buttons, menus, etc.
# that may be appropriate for their environment.  For example, if most of the
# users were accustomed to uwm, the defaults could be set up not to decorate
# any windows and to use meta-keys.
#

SortIconManager
RandomPlacement
ShowIconManager
NoGrabServer
RestartPreviousState
DecorateTransients
TitleFont "-adobe-times-bold-r-normal--*-120-*-*-*-*-*-*"
ResizeFont "-adobe-times-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-times-bold-r-normal--*-120-*-*-*-*-*-*"
IconFont "-adobe-times-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-times-bold-r-normal--*-100-*-*-*"
ShowWorkSpaceManager			# start with workspcace manager up
UseThreeDMenus
UseThreeDTitles
UseThreeDIconManagers
UseThreeDBorders
UseThreeDWMap
SunkFocusWindowTitle

#
## This defines the rectangular widget that contains the two rows of 5
## workspaces.  It can be defined as large (in pixels) as you want,
## and place on top or bottom [or anywhere else] as you wish.
#
workspacemanagergeometry        "360x70+427+0" 5 # ::gdk:: 27jun97

WorkSpaces {
    "NetSysadmin" {"#686B9F" "white" "DeepSkyBlue3" "white" }
    "System_I"   {"#619AAE" "white" "firebrick" "white"}
    "System_II"   {"#619AAE" "white" "firebrick" "white"}
    "Writing" {"#727786" "white" }
    "Programming"  {"#8C5b7A" "white" "MidnightBlue"}
    "Mail"   {"#619AAE" "white" "DeepSkyBlue3" "white"  }

    "SageAdmin"  {"#727786" "white" "firebrick" "white" }
    "TaoAdmin"  {"#727786" "white" "firebrick" "white" }
    "Browser" {"#8C5b7A" "white" "chartreuse4"}
    "Scratch" {"#686B9F" "white" "MidnightBlue" "white" "xpm:hubble.xpm" }
}

    
#
## test: added 04may05
#
RightTitleButton ":xpm:iconify" {
    Button1 : f.delete
}
RightTitleButton "%xpm:zoom-inout" {
    Button1 : f.fullzoom
}
RightTitleButton ":xpm:cross" {
    Button1 : f.delete
}
        



Color
{
    BorderColor           "Red"
    DefaultBackground     "blue"
    DefaultForeground     "gray85"
    BorderTileBackground  "DeepSkyBlue1" {
	"xterm"		"DeepSkyBlue3"
    }
    BorderTileForeground  "Black" {
	"xterm" "DeepSkyBlue3"
    }
    TitleBackground       "DeepSkyBlue1" {
	"xterm" "DeepSkyBlue3"
    }
    TitleForeground       "Black" {
	"xterm" "White"
    }
    MenuBackground        "#686B9F"
    MenuForeground        "white"
    MenuTitleBackground   "gray70"
    MenuTitleForeground   "White"
    IconBackground        "LightSlateBlue"
    IconForeground        "White"
    IconBorderColor       "gray85"
    IconManagerBackground "DeepSkyBlue1" {"Axe" "DeepSkyBlue3" "xload" "DeepSkyBlue2"}
    IconManagerForeground "Black"
    MapWindowBackground   "DeepSkyBlue1" {
	"root*" "Red"
	"xterm" "DeepSkyBlue3"
	"Axe"	"Yellow"
    }
    MapWindowForeground   "Black" {
	"xterm" "White"
    }
}

IconManagerDontShow {
    "WorkSpaceManager"
}

NoTitle {                  # little programs that look like icons
    "TWM Icon Manager"
    "WorkSpaceManager"
    "xload"
    "xpbiff"
    "asapm"
    "xcalendar"
}
#
# Define some useful functions for motion-based actions.
#
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 "defops"
Button2 =       : root		: f.menu "windowops"
Button3 =       : root		: f.menu "windowfns"

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.zoom

Button1 =	: icon		: f.function "move-or-iconify"
Button2 =	: icon		: f.iconify

Button1 =	: iconmgr	: f.iconify
Button2 =	: iconmgr	: f.iconify
Button3 =	: iconmgr	: f.zoom

Button1 =       : frame         : f.resize
Button1 = m     : frame         : f.move
Button2 =       : frame         : f.raiselower
Button3 =       : frame         : f.zoom
#
# And a menus with the usual things
#
menu "defops"
{
    "CTWM"		f.title
    ""			f.nop
    "Autoraise"		f.autoraise
    ""			f.nop
    "Delete Window"	f.delete
    ""			f.nop
    "linux-firefox"	!"linux-firefox &"
    "linux-mozilla"	!"linux-mozilla &"
    ""			f.nop
    "SizeToggle"	f.fullzoom
    "Mutt"		!"mailxterm -fn -adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1 -g 80x51-16-0 -sb -sl 1024 -n mutt -e mutt  &"

    ""			f.nop
    "Xterm"		!"xterm&"
    "Calculator"	!"xcalc&"
    "Xman"		!"xman &"
    ""			f.nop
    "Editors"		f.menu "editors"
    ""			f.nop
    "Solitaire"         !"tksol &"
    "Xtriangles"        !"xtriangles &"
    "Xtic"		!"xtic &"
    ""			f.nop
    "Restart"		f.restart
    "Shutdown"		f.menu "shutdown"
    ""			f.nop
    "Exit"		f.quit
}

menu "windowops" {
    "Window Operations"	f.title
    "Occupy"		f.occupy
    "Occupy All"	f.occupyall
    "Iconify"		f.iconify
    "Refresh"		f.refresh
    "Vanish"		f.vanish
    "Info"		f.identify
    ""			f.separator
    "Resize"		f.resize
    "Move"		f.move
    "Adopt Window"	f.adoptwindow
    "Animate"		f.startanimation
    "Don't animate"	f.stopanimation
    ""			f.separator
    "Delete"	f.delete
    "Kill Window"	f.destroy
    "Pin menu"		f.pin
}

menu "windowfns" {
    "Window Functions"	f.title
    "Iconify"		f.iconify
    "RaiseLower"	f.raiselower
    "Refresh"		f.winrefresh
    "Zoom"		f.zoom
    "Vanish"		f.vanish
    "Focus"		f.focus
    "Unfocus"		f.unfocus
    ""			f.separator
    "Delete"	f.delete
    "Kill Window"	f.destroy
    "Resize..." 	f.resize
    "Move..."		f.move
}

menu "iconmenu" {
    "Actions"		f.title
    ""			f.separator
    "Restore"		f.iconify
    "Move"		f.move
    "Occupy ..."	f.occupy
    "Occupy All"	f.occupyall
    ""			f.separator
    "Send Delete"	f.delete
    "Kill Window"	f.destroy
}

  
menu "editors"
{
    "XEmacs..."         !"xemacs &"
    "aXe"          	!"axe &"
    ##"TextEdit..."       !"/usr/openwin/bin/textedit &"
    ##"XTextEdit..."      !"/usr/bin/X11/textedit &"
}

menu "shutdown"
{
    ""			f.separator
    ""			f.separator
    "Shutdown-Reboot"   !"/sbin/shutdown -r now &"
    "Shutdown-Halt"   !"/sbin/shutdown -h now &"
    "Shutdown To SingleUser"   !"/sbin/shutdown now &"
    ""			f.separator
    ""			f.separator
}


### HERE ###

Occupy 
{
	# Evidently the prefix term ``Window'' required.

	Window "Xtermb" {"Writing"}
	Window "xterm" {"NetSysadmin"}        
	Window "progxterm" {"Programming"}  # Java pops up here, too.
	Window "newsxterm"   {"SageAdmin"}
	Window "taoxterm"   {"TaoAdmin"}
	Window "xcpustate" {"System_I"}
		"xosview"  {"System_I"}
		"xsysinfo" {"System_I"}
		"sys1xterm" {"System_I"}

		"top"	   {"System_II"}
		"sysrxvt"  {"System_II"}
		"xperfmon++"  {"System_II"}
		"xtermE"  {"System_II"}
		"xlbiff"   {"System_II"}

	Window "netxterm" {"Browser"}        
	Window "scratchxterm" {"Scratch"}        
	Window "mailxterm"   {"Mail"}
	###Window "xlbiff"   {"Mail"}
}
OccupyAll
{
	"xload"
	"rclock"
	"xdaliclock"
	"asapm"
	"xcalendar"
}

IconManagerDontShow
{
        "xload"
        "xperfmon"
        "perfmeter"
	"xcalendar"
	"xpad"
}

NoTitle
{
        "xload"
        "rclock"
        "xperfmon"
        "asapm"
        "perfmeter"
	"xcalendar"
	"xpad"
}

AutoRaise
{
	"XtraScreen"
        "Mail"
        "XMail"
        "Dyna"
        "Solitude"
        "Sunshine"
        "XScribe"
        "Tao"
        "System Admin"
        "SysAdmin Beta"
        "Java"
        "Main DolichoView"
	"Cafe"
        "Steel"
        "XSage"
        "Sadmin"
        "XSageAdmin"
	"links"
}

ChangeWorkspaceFunction !"/bin/cat /home/kline/sounds/chimes.wav > /dev/audio&"
IconifyFunction     !"/bin/cat /home/kline/sounds/click.wav > /dev/audio &"
DeIconifyFunction   !"/bin/cat /home/kline/sounds/mellowbweep.wav > /dev/audio&"


#
#
#==========================================================================
# Shift/Control/Lock/Meta/mod[1-5]      -- key modifiers
# Window, Title, Icon, Root, Frame, iconMgr -- mouse locations
#
#
"F1" =  : all   :   f.fullzoom
"F2" =  : w | t | f   :   f.iconify
"F3" =  : all   :   f.raiselower
"F4" =  : all   :   f.lower
"F5" =  : all   :   f.raise
"F6" =  : all   :   f.zoom
"F7" =  : w | t | f   :   f.hzoom
"F8" =  : w | t | f   :   f.hbzoom
#
#==========================================================================
#
"F9" =   : w | t | f   :   f.leftworkspace
"F10" =  : w | t | f   :   f.rightworkspace
"F11" =  : w | t | f   :   f.upworkspace
"F12" =  : w | t | f   :   f.downworkspace






Screenshots

My Networking and System Admin Workspace


My Browser Workspace


Back to top of page