#****************
#    ctwm.rc
#****************

# variables
# =========
IconDirectory        "/usr/local/include/X11/bitmaps"
PixmapDirectory        "/usr/local/include/X11/pixmaps"
NoDefaults
#NoVersion
NoGrabServer
#NoRaiseOnMove
#NoRaiseOnResize
#NoMenuShadows
NoTitleHighlight
#NoHighlight
#NoTitleFocus
NoSaveUnders
DontSqueezeTitle
ConstrainedMoveTime 300
DecorateTransients
Zoom
#TitleButtonBorderWidth 0
#ButtonIndent 2
OpaqueMove # to use movepush need this
NoShowOccupyAll
AutoOccupy
#ClientBorderWidth
RaiseDelay 700
#BorderWidth    3
RandomPlacement
IconRegion  "150x500-0-0" North West 75 70
IconRegion  "320x200-0-500" North West 160 70
UsePPosition "on"

# 3.0
UseThreeDIconManagers
UseThreeDMenus
UseThreeDTitles
SunkFocusWindowTitle
#BeNiceToColormap
#ClearShadowContrast 25
#DarkShadowContrast 75
BorderWidth    6
NoTitleHighlight

# 3.1
AnimationSpeed 0
MaxIconTitleWidth 500
ThreeDBorderWidth 6
UseThreeDBorders
WarpRingOnScreen

# 3.2
DontMoveOff
MoveOffResistance 25
BorderResizeCursors

# 3.3
#AlwaysShowWindowWhenMovingFromWorkspaceManager
#ReallyMoveInWorkspaceManager
MovePackResistance 25
UseThreeDWMap
#ReverseCurrentWorkspace
#MapWindowBackground
#MapWindowForeground

MapWindowCurrentWorkSpace {"Red"  "SkyBlue"  "Blue"  
"/usr/local/include/X11/bitmaps/ants.xbm"}


TitleFont    "-*-helvetica-bold-o-normal--*-140-*-*-*-*-iso8859-1"
MenuFont    "-*-helvetica-bold-r-normal--*-140-*-*-*-*-iso8859-1"
IconFont    "-*-helvetica-bold-r-normal--*-140-*-*-*-*-iso8859-1"
ResizeFont    "-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"
IconManagerFont    "-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"
ShowIconManager
SortIconManager
IconManagerGeometry    "200x100-0+0"

ShowWorkSpaceManager
StartInMapState
workspacemanagergeometry        "325x80-0-0" 4
WorkSpaces {
    "One"   {"grey" "black" "grey70" "DeepSkyBlue3"
      "/usr/local/include/X11/bitmaps/pf.xbm" }
    "Two"   {"grey" "white" "grey70" "coral3"
      "/usr/local/include/X11/bitmaps/votes.xbm" }
    "Three" {"grey" "white" "grey70" "Sienna"
      "/usr/local/include/X11/bitmaps/eight.xbm" }
    "Four"  {"grey" "white" "grey70" "OliveDrab"
      "/usr/local/include/X11/bitmaps/tiger.xbm" }
}


# nice colors:  background of wheat, foreground of #d36

Cursors
{
    Frame   "left_ptr"
    Title   "left_ptr"
    Icon    "left_ptr"
    IconMgr "left_ptr"
    Move    "fleur"
    Resize  "sizing"
    Menu    "X_cursor"
    Button  "left_ptr"
    Wait    "clock"
    Select  "target"
    Destroy "pirate"
}

Color
{
#    BorderColor "Black"
#    BorderTileBackground "Wheat"
    BorderColor "Black"
    BorderTileBackground "SteelBlue"
    TitleBackground "SteelBlue"
    TitleForeground "Black"
    MenuBackground "Wheat"
    MenuForeground "Black"
    MenuTitleBackground "SteelBlue"
    MenuTitleForeground "Black"
    IconBackground "LightBlue"
    IconForeground "Black"
    IconBorderColor "Wheat"
    IconManagerBackground "LightGray"
    IconManagerForeground "Black"
    IconManagerHighlight "Wheat"
    MapWindowBackground "Khaki"
    MapWindowForeground "Black"
}


Monochrome
{
    MapWindowBackground "white"
    MapWindowForeground "black"
    IconManagerHighlight    "black"
}


ForceIcons

NoTitle
{
    "WorkSpaceManager"
    "TWM Icon Manager"
}

UnknownIcon    "xpm:nothing.xpm"

Icons
{
    "XTerm"         "xpm:xterm.xpm"
    "DECW$TERMINAL" "xpm:term.xpm"
    "DECW$CALC"     "xpm:xcalc.xpm"
    "HPterm"        "xpm:hpterm.xpm"
    "Emacs"         "xpm:emacs.xpm"
    "XJed"          "xpm:gnu-emacs%.xpm"
#    "XJed"          "xpm:xedit.xpm"
    "Tpu"           "xpm:xedit.xpm"
#    "VUE$MASTER"    "xpm:peter.xpm"
    "VUE$MASTER"    "xpm:ball%.xpm"
#    "VUE$MASTER"    "~supman%.xbm"
    "Ghostview"     "xpm:ghostview.xpm"
    "ApplicationShell"  "xpm:cdrom1.xpm"
    "Mosaic"        "xpm:xmosaic.xpm"
#    "MXRN"          "xpm:xrn.xpm"
#    ""    "xpm:.xpm"
}

# f.warpring acts along these windows
WindowRing
{
    "XTerm"
    "DECW$TERMINAL"
    "HPterm"
    "Emacs"
    "XJed"
    "Tpu"
    "Ved"
}

AutoRaise
{
#"Untitled"
}

NoTitle
{
    "DClock"
    "XClock"
    "XDaliClock"
    "XOsview"
}

OccupyAll
{
    "DClock"
    "XClock"
    "XDaliClock"
    "XOsview"
}

IconManagerDontShow {
    "WorkSpaceManager"
    "XClock"
    "XDaliClock"
    "XOsview"
}

MoveDelta 3

DefaultFunction f.nop

# functions
# =========
Function "move-or-raise"
{
    f.move
    f.deltastop
    f.raise
}

Function "raise-or-resize"
{
    f.raise
    f.deltastop
    f.resize
}

Function "move-or-iconify"
{
    f.move
    f.deltastop
    f.iconify
}

# bindings
# ========
LeftTitleButton ":xpm:bar" {
    Button1 : f.menu "titleops"
}
RightTitleButton ":xpm:dot" {
    Button1 : f.iconify
}
RightTitleButton ":xpm:resize" {
    Button1 : f.resize
}
Button1 = : title       : f.function "move-or-raise"
Button1 = s : title     : f.movepack
Button1 = c : title     : f.movepush
Button2 = : title       : f.menu "TMenu"
Button3 = : title       : f.resize
Button1 = : frame       : f.function "raise-or-resize"
Button2 = : frame       : f.function "move-or-raise"
Button2 = s : frame     : f.movepack
Button2 = c : frame     : f.movepush
Button1 = : icon        : f.function "move-or-iconify"
Button2 = : icon        : f.iconify
Button1 = : iconmgr     : f.iconify
Button1 = : root        : f.menu "ctwmops"
Button2 = : root        : f.menu "windowops"
Button3 = : root        : f.menu "Linuxstuff"
"F3"    = s : all    : f.warpring "next"
"F4"    = s : window    : f.destroy
"F6"    = : window|icon : f.raiselower
#"F7"    = : window|icon : f.raiselower
#"F9"    = : icon|iconmgr     : f.iconify
# "F10"   = s : window    : f.vanish
"F9"   = : all         : f.prevworkspace
"F10"   = : all         : f.nextworkspace
"F9"   = s : all         : f.prevworkspace
"F10"   = s : all         : f.nextworkspace
#"F11"   = : all         : f.prevworkspace
#"F12"   = : all         : f.nextworkspace
#"F11"   = s : all         : f.prevworkspace
#"F12"   = s : all         : f.nextworkspace
#"Up"    = s|c : all     : f.upiconmgr
#"Down"  = s|c : all     : f.downiconmgr

# menus
# =====
menu "TMenu" {
    "Title Menu" f.title
    "Iconify"    f.iconify
    ""           f.separator
    "Occupy"     f.occupy
    "Occupy all" f.occupyall
}

menu "ctwmops"
{
    "PeterC"        f.title
#    "DECterm"       !"create/terminal/nobroadcast/detach DECterm"
#    "Eve"  !"edit/tpu/display=DECwindows/init=MPHV2$USER2:[PETERC.C]PREF.EWE"
    "Rxvt"         !"rxvt -fat -sl 512 &"
    "Xterm"         !"xterm -j -rw -s -sb -ah -sl 512 &"
#    "Xterm (small)" !"xterm -fn fixed -fb fixed -j -rw -s -sb -ah -sl 512"
#    "News"          !"mxrn"
#    "HH"            f.menu "hh"
    "XJed"         !"/usr/local/bin/xjed -font 10x20 -geometry 80x32+0+0 &"
    "XJed (small)" !"/usr/local/bin/xjed &"
    ""             f.nop
    ""              f.separator
    "More stuff"    f.menu "Linuxstuff"
    "Workspace ops" f.menu "workspace"
    "Animation"    f.menu "Anim"
    ""             f.nop
    ""              f.separator
#    "Pause"         !"run sys$system:decw$pausesession"
    ""              f.separator
    "Goto Window"     f.menu "TwmWindows"
    "Goto Workspace"  f.menu "TwmWorkspaces"
    ""             f.nop
    ""              f.separator
    "Restart CTwm"     f.restart
    "Exit CTwm"     f.quit
}

menu "windowops"
{
    "Windows"      f.title
    "Pin menu"     f.pin
    "Kill"         f.menu "Kill"
    "Save"         f.saveyourself
    "Refresh All"  f.refresh
    "Refresh"      f.winrefresh
    "Occupy"       f.occupy
    "Occupy All"   f.occupyall
    "Vanish"       f.vanish
    ""              f.separator
    "Iconify"      f.iconify
    "Resize"       f.resize
    "RaiseLower"   f.raiselower
    "Move"         f.move
    "Raise"        f.raise
    "Lower"        f.lower
    "Info"         f.identify
    "Focus"        f.focus
    "Unfocus"      f.unfocus
    "Animation"    f.menu "Anim"
    "Zoom"         f.menu "Zoom"
}

menu "Linuxstuff"
{
    "Odds and Ends"  f.title
    "*Calculator"     !"xcalc &"
    "Xmanual"        !"xman &"
#    "DECterm"        !"create/terminal/detatch DECTERM"
#    "Editor"         !"edit/tpu/display=DECwindows"
#    "XMosaic"        !"xmosaic"
    "XPaint"          !"xpaint &"
    "Xv"             !"xv &"
#    ""              f.separator
#    "Games"          f.menu "games"
}

menu "Kill"
{
    "Pin menu"     f.pin
    "*Kill Window"  f.destroy
    "Send Delete"  f.delete
}

menu "games"
{
    "Games"    f.title
#    "Puzzle"   !"run sys$system:decw$puzzle"
#    "Xchomp"   !"run manc$x11:xchomp"
#    "Xroach"   !"@manc$x11:xroach"
}

menu "workspace"
{
    "Show Icon Box"  f.showiconmgr
    "Hide Icon Box"  f.hideiconmgr
    ""              f.separator
    "Toggle Manager" f.togglestate
    "Show Manager"   f.showworkspacemgr
    "Hide Manager"   f.hideworkspacemgr
    ""              f.separator
    "*Occupy"         f.occupy
    "Occupy all"     f.occupyall
}

menu "Zoom" {
    "Full"       f.fullzoom
    "Horizontal" f.horizoom
    "Vertical"   f.zoom
    "Left"       f.leftzoom
    "Top"        f.topzoom
    "Right"      f.rightzoom
    "Bottom"     f.bottomzoom
}

menu "Anim" {
    "Start"       f.startanimation
    "*Stop"       f.stopanimation
    "Faster"       f.speedupanimation
    "Slower"       f.slowdownanimation
}

menu "titleops"
{
    "Title Bar"    f.title
    "RaiseLower"   f.raiselower
    "Iconify"      f.iconify
    "Info"         f.identify
    "Focus"        f.focus
    "Unfocus"      f.unfocus
    "Refresh"      f.winrefresh
    "Occupy"       f.occupy
    "Occupy All"   f.occupyall
    "Vanish"       f.vanish
    ""              f.separator
    "Send Delete"  f.delete
    "Kill Window"  f.destroy
    "Zoom"         f.menu "Zoom"
}
