.ctwmrc

CTWM screenshot

The configuration file for the ctwm window manager with some custom pixmaps and a screenshot.

#---------------------------------------------------------
# EMERGENCY
# This line is here so that U will be able 2 restart CTWM
# even if the rest of the file doesn't work very well!
#---------------------------------------------------------

"F9" = s : r|w|t|m|f : f.twmrc  #shift "L2": source .ctwmrc

#---------------------------------------------------------
# FONTS
#---------------------------------------------------------
TitleFont       "-*-helvetica-medium-r-*-*-12-*-100-100-*-*-*-5"
ResizeFont      "-*-helvetica-medium-r-*-*-12-*-100-100-*-*-*-5"
MenuFont        "-*-helvetica-medium-r-*-*-12-*-100-100-*-*-*-5"
IconFont        "-*-helvetica-medium-r-*-*-12-*-100-100-*-*-*-5"
IconManagerFont "-*-helvetica-medium-r-*-*-12-*-100-100-*-*-*-5"

#---------------------------------------------------------
# GENERAL
#---------------------------------------------------------
NoGrabServer
AutoOccupy
RandomPlacement "on"                    # ask for pos?
RestartPreviousState
DecorateTransients
ShowWorkSpaceManager                    # start with workspace manager up
ShowIconManager
UseThreeDMenus
# UseThreeDTitles
# UseThreeDIconManagers
UseThreeDWMap
SunkFocusWindowTitle
RaiseDelay 250
AutoRaise
MaxWindowSize 1024x768
#DontPaintRootWindow                     # useful to have pixmap per Workspace
NoShowOccupyAll                         # won't be displayed in the WorkSpaceMap window

#---------------------------------------------------------
# SETS
#---------------------------------------------------------
WorkSpaces {
  "Term"  {"rgb:0/6/6" "rgb:f/f/f" "rgb:0/6/6" "rgb:f/f/f"}
  "Web"   {"rgb:4/4/6" "rgb:f/f/f" "rgb:4/4/6" "rgb:f/f/f"}
  "Mail"  {"rgb:6/4/4" "rgb:f/f/f" "rgb:6/4/4" "rgb:f/f/f"}
  "Emacs" {"rgb:6/6/6" "rgb:f/f/f" "rgb:6/6/6" "rgb:f/f/f"}
  "Gimp"  {"rgb:0/4/4" "rgb:f/f/f" "rgb:0/4/4" "rgb:f/f/f"}
  "Root"  {"rgb:2/2/4" "rgb:f/f/f" "rgb:2/2/4" "rgb:f/f/f"}
}

Color {
  BorderColor           "grey70"
  DefaultBackground     "grey70"
  DefaultForeground     "Black"
  BorderTileBackground  "grey80"
  BorderTileForeground  "grey50"
  TitleBackground       "grey80"
  TitleForeground       "Black"
  MenuBackground        "grey70"
  MenuForeground        "Black"
  MenuTitleBackground   "DarkSlateBlue"
  MenuTitleForeground   "grey20"
  IconBackground        "grey70"
  IconForeground        "grey10"
  IconBorderColor       "grey30"
  IconManagerBackground "grey70"
  IconManagerForeground "grey10"
  MapWindowBackground   "grey70"
  MapWindowForeground   "grey10"
}

IconManagerDontShow {   # do not display these windows in the icon manager
  "xrus"
  "wmbiff"
  "wmWeather"
  "xclock"
  "xload"
}

NoTitle {               # do not place a title bar on these windows
  "wmbiff"
  "WorkSpaceManager"
  "TWM Icon Manager"
  "xrus"
  "wmWeather"
  "xclock"
  "xload"
}

NoBorder {
  "wmbiff"
  "xrus"
  "WorkSpaceManager"
  "TWM Icon Manager"
  "wmWeather"
  "xclock"
  "xload"
}


OccupyAll {
  "wmbiff"
  "xrus"
  "wmWeather"
  "xclock"
  "xload"
}

# NoIconTitle {                         # don't put title under icons
                                        # optional winlist
# }

StartIconified {
  "Download"
  "Save file"
}

Occupy                                  # always move this app. to the same
{                                       # workspace?
  "Netscape"  {"Web"}
  "Mozilla"   {"Web"}
  "Emacs"     {"Emacs"}
  "mutt"      {"Mail"}
  "Gimp"      {"Gimp"}
}


#---------------------------------------------------------
# FUNCTIONS
#---------------------------------------------------------

#
# 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 }

Function "movetoworkspace_1" { f.addtoworkspace "Term"  f.vanish }
Function "movetoworkspace_2" { f.addtoworkspace "Web"   f.vanish }
Function "movetoworkspace_3" { f.addtoworkspace "Mail"  f.vanish }
Function "movetoworkspace_4" { f.addtoworkspace "Emacs" f.vanish }
Function "movetoworkspace_5" { f.addtoworkspace "Gimp"  f.vanish }
Function "movetoworkspace_6" { f.addtoworkspace "Root"  f.vanish }

#---------------------------------------------------------
# MENUS
#---------------------------------------------------------
#
# And a menus with the usual things
#

menu "defops" {
    "Main Menu"                 f.title
    "Debian"                    f.menu "/Debian"
    ""                          f.separator
    "Show Icon Manager"         f.showiconmgr
    "Hide Icon Manager"         f.hideiconmgr
    ""                          f.separator
    "Show WorkSpace Manager"    f.showworkspacemgr
    "Hide WorkSpace Manager"    f.hideworkspacemgr
    ""                          f.separator
    "Refresh screen"            f.refresh
    ""                          f.separator
    "Exit"                      f.menu "Quit-Verify"
}

menu "Quit-Verify" {
    "Really quit ctwm?"         f.title
    "No, restart ctwm"          f.restart
    "Yes, really quit"          f.quit
}

menu "windowops" {
    "Window Ops"                f.title
    "Occupy..."                 f.occupy
    "Occupy All"                f.occupyall
    "Vanish"                    f.vanish
    ""                          f.separator
    "(De)Iconify"               f.iconify
    "Refresh"                   f.winrefresh
    "Info..."                   f.identify
    ""                          f.separator
    "Resize"                    f.resize
    "(Un)Squeeze"               f.squeeze
    "Zoom"                      f.menu "zoomops"
    ""                          f.separator
    "Move"                      f.move
    "Pack move"                 f.movepack
    "Push move"                 f.movepush
    ""                          f.separator
    "Restart animations"        f.startanimation
    "Freeze animations"         f.stopanimation
    ""                          f.separator
    "Close"                     f.delete
    "Kill"                      f.destroy
}

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

menu "clone_menu" {
    "move to 'Term'"      f.function "movetoworkspace_1"
    "move to 'Web'"       f.function "movetoworkspace_2"
    "move to 'Mail'"      f.function "movetoworkspace_3"
    "move to 'Emacs'"     f.function "movetoworkspace_4"
    "move to 'Gimp'"      f.function "movetoworkspace_5"
    "move to 'Root'"      f.function "movetoworkspace_6"
    "" f.separator
    "copy to 'Term'"      f.addtoworkspace "Term"
    "copy to 'Web'"       f.addtoworkspace "Web"
    "copy to 'Mail'"      f.addtoworkspace "Mail"
    "copy to 'Emacs'"     f.addtoworkspace "Emacs"
    "copy to 'Gimp'"      f.addtoworkspace "Gimp"
    "copy to 'Root'"      f.addtoworkspace "Root"
}

sinclude(`/etc/X11/ctwm/menudefs.hook')

#---------------------------------------------------------
# BUTTONS
#---------------------------------------------------------

"F1" = m : all : f.gotoworkspace "Term"
"F2" = m : all : f.gotoworkspace "Web"
"F3" = m : all : f.gotoworkspace "Mail"
"F4" = m : all : f.gotoworkspace "Emacs"
"F5" = m : all : f.gotoworkspace "Gimp"
"F6" = m : all : f.gotoworkspace "Root"
"Tab"     = m   : all  : f.circleup
"Tab"     = m3  : all  : f.circledown

Button1 =       : root          : f.menu "defops"
Button2 =       : root          : f.menu "windowops"
Button3 =       : root          : f.exec "aterm &"

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

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

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

Button1 =       : frame         : f.resize
Button1 = m     : frame         : f.move
Button2 =       : frame         : f.raiselower


#---------------------------------------------------------
# TITLEBAR
#---------------------------------------------------------

NoDefaults # not use default buttons

LeftTitleButton  "HOME/.ctwm/Mmenu-m.xbm"=f.menu "windowops"
LeftTitleButton  "HOME/.ctwm/Mmenu-c.xbm"=f.menu "clone_menu"
RightTitleButton  "HOME/.ctwm/Msqueeze.xbm"=f.squeeze
RightTitleButton  "HOME/.ctwm/Mmax-h.xbm"=f.hzoom
RightTitleButton  "HOME/.ctwm/Mmax-v.xbm"=f.zoom
RightTitleButton  "HOME/.ctwm/Mmax-a.xbm"=f.fullzoom
RightTitleButton  "HOME/.ctwm/Mmin.xbm" = f.iconify
RightTitleButton "HOME/.ctwm/Mresize.xbm"    = f.resize
RightTitleButton "HOME/.ctwm/Mkill-x.xbm"=f.deleteordestroy

TitleButtonBorderWidth 0
TitleButtonShadowDepth 0
TitleShadowDepth 1
NoTitleHighlight
NoTitleFocus                            # keyboard input at pointer
TitleButtonShadowDepth     1
TitleShadowDepth           1
TitleButtonBorderWidth     1

TitlePadding               4             # frame around TBobjects?
ButtonIndent               0             # indentated TBbuttons?         
FramePadding               1             # frame around TB?

#---------------------------------------------------------
# BORDER
#---------------------------------------------------------

UseThreeDBorders
BorderWidth                1
ThreeDBorderWidth          2
Borderwidth                2
BorderShadowDepth          1


#---------------------------------------------------------
# ICONS
#---------------------------------------------------------
define(IRegion, translit(eval(WIDTH/3)*eval(HEIGHT/2)+eval(WIDTH-WIDTH/3)-0, *, x))
IconRegion  "IRegion" NORTH EAST 30 30

ForceIcons                              # use icons put below, not default
IconifyByUnmapping                      # no icon when iconified
# NoRaiseOnDeiconify                    # raise deiconified wins?
# AutoRaiseIcons                        # raise icons when under cursor
# IconDirectory           ""            # dir. for bitmapI
IconJustification         "center"      # where put image/title?
MaxIconTitleWidth         80
IconBorderWidth           0             # frame around I?
# UnknownIcon             ""            # bitmap to use for unknown?
SchrinkIconTitles                       # shrink icon titles a'la Motif

# Where on the screen to put icons and how to place them.
# IconRegion                "140x684+0+0"   North East 130 90  { }
# IconRegion                "140x684+140+0" North East 130 90  { }
IconRegionAlignement     "bottom"
IconRegionJustification  "center"


#---------------------------------------------------------
# ICON MANAGER
#---------------------------------------------------------
ShowIconManager                         # activate/deactivate IM
# NoIconManagers                        # activate/deactivate IM
UseThreeDIconManagers
SortIconManager                         # sorts alphabetically
# NoCaseSensitive                       # sort with case?
IconManagerShadowDepth    1
NoIconManagerFocus                      # !focus the win under cursor in IM
# Icon Manager Geometry:  Size: Columns:
IconManagerGeometry                     "150x50-1+1" 1
MaxIconTitleWidth 100
Zoom 8

#---------------------------------------------------------
# MENUS
#---------------------------------------------------------
MenuShadowDepth            1             # how big shadow? (1 looks good)
MenuShadowColor            "grey15"
IconManagerShadowDepth     1


#---------------------------------------------------------
# WORKSPACE MANAGER
#---------------------------------------------------------
ReallyMoveInWorkspaceManager
# StartInMapState 
WorkSpaceManagerGeometry   "150x75-0-0" 3
WMgrButtonShadowDepth      2
WMgrHorizButtonIndent      2
WMgrVertButtonIndent       2

#SqueezeTitle
IconJustification "center"
TitleJustification "center"


#Button1  =   : title    : f.altcontext
#DoubleButton1  =   : alter    : f.squeeze
Button1 = c : root : f.menu "TwmWindows"