# -*- shell-script -*- ### Time-stamp: <2007-06-09 12:03:49 MEST> ### CTWM configuration file by M.C. Widerkrantz, mc at hack.org. ### http://hack.org/mc/ ### ### A grey and white, very slim, slightly vector like 2D look that ### works with or without title bars, if wanted. Provides keybindings ### and mouse actions for common tasks like moving, zooming, resizing ### windows as well as warping between windows, without getting in the ### way of Emacs key bindings. # Remember the state of client windows if we're started after another # window manager. RestartPreviousState Color { DefaultBackground "#808080" DefaultForeground "white" # Unfocused border. A solid colour. BorderTileBackground "rgb:6/6/6" BorderTileForeground "rgb:6/6/6" # Grey BorderColor "rgb:c/c/c" TitleBackground "#808080" TitleForeground "white" MenuBackground "#808080" MenuForeground "white" MenuTitleBackground "#808080" MenuTitleForeground "white" MapWindowBackground "#808080" MapWindowForeground "white" IconManagerBackground "#808080" IconManagerForeground "white" IconManagerHighlight "white" } ### You may have to change the XorValue variable depending on how ### different colours are in your palette. This is a good XOR value on ### an 8 bit display like the cgsix on my Sun SPARCstation 5. On more ### modern hardware this is generally not needed. #XorValue 1 ### Nice pointer glyphs depending on where the mouse has moved the ### pointer. Cursors { Frame "left_ptr" Title "left_ptr" Move "fleur" Resize "sizing" Menu "right_ptr" Button "right_ptr" Wait "watch" Select "target" Destroy "pirate" Icon "box_spiral" IconMgr "left_ptr" } Pixmaps { TitleHighlight "/home/mc/solid.xbm" } ### The great Artwiz Snap and Edges fonts make for a nice retro look. TitleFont "-artwiz-snap.se-normal-r-normal--10-100-75-75-p-90-iso8859-1" MenuFont "-artwiz-snap.se-normal-r-normal--10-100-75-75-p-90-iso8859-1" ResizeFont "-artwiz-snap.se-normal-r-normal--10-100-75-75-p-90-iso8859-1" WorkSpaceFont "-artwiz-edges.se-medium-r-normal--10-100-75-75-m-50-iso8859-1" ### If you don't have the Artwiz fonts, uncomment these instead. #TitleFont "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-8859-1" #MenuFont "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-8859-1" #ResizeFont "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-8859-1" #WorkSpaceFont "-*-helvetica-medium-r-*-*-8-*-*-*-*-*-8859-1" TitleJustification "left" ### Go directly to the menu entry if the user taps the corresponding ### key, ignoring case. IgnoreCaseInMenuSelection DecorateTransients # Temporary child windows also get decorations. NoGrabServer # Permit X events to update server while doing stuff. UsePPosition "on" # Honour window's own placement. WarpCursor # Move cursor to middle of window when warping. DontMoveOff # Keep things on the physical screen. ### Remove the the "opaque" lines below if you're on a fast display ### and you can move the contents of the windows instead of an ### outline. Not quite usable on an unaccellerated X server or old ### graphics hardware. #OpaqueMove #OpaqueResize ### Size of windows (in percentage of the screen estate) where ctwm ### will show windows' contents while moving or resizing. OpaqueMoveThreshold 40 OpaqueResizeThreshold 10 ### Sloppy focus will only work in CTWM versions >= 3.6. #SloppyFocus ### Try not to overlap existing windows when mapping a new window. PackNewWindows ### Place new windows wherever. RandomPlacement "on" # No icons, please. Ever. IconifyByUnmapping ### Don't show icon managers or workspaces in windows or icon menus. ShortAllWindowsMenus ### But let the menus stay up on screen. StayUpMenus ### Avoid 'technicolor effect' on decorations if we have very few ### colours. SaveColor { BorderColor BorderTileBackground BorderTileForeground TitleBackground TitleForeground } ### If I set the root window to contain something nice to look at, I ### don't want ctwm to repaint it when I shift workspaces. DontPaintRootWindow WorkSpaces { "1" { "#808080" "white" "black" "goldenrod" } "2" { "#808080" "white" "black" "goldenrod" } "3" { "#808080" "white" "black" "goldenrod" } "4" { "#808080" "white" "black" "goldenrod" } "5" { "#808080" "white" "black" "goldenrod" } "6" { "#808080" "white" "black" "goldenrod" } "7" { "#808080" "white" "black" "goldenrod" } "8" { "#808080" "white" "black" "goldenrod" } "9" { "#808080" "white" "black" "goldenrod" } "10" { "#808080" "white" "black" "goldenrod" } } ### Look of the workspace manager, if visible at all. ShowWorkSpaceManager WorkSpaceManagerGeometry "400x60-0-0" 10 StartInMapState UseThreeDWMap MapWindowCurrentWorkSpace { "rgb:c/c/c" "black" "white" } WMgrButtonShadowDepth 0 WMgrHorizButtonIndent 0 WMgrVertButtonIndent 0 ### Don't show windows that occupies all workspaces in the workspace ### manager. NoShowOccupyAll ### If I'm using ctwm and not twm, these can make the decorations look ### 3D. Uncomment for this effect. UseThreeDMenus MenuShadowDepth 1 ### Paint a thin border around windows. BorderWidth 1 # But if we're running a ctwm, we might want to use slightly thicker # 3D borders with a 1 pixel shadow. Uncomment below to use them. #UseThreeDBorders ThreeDBorderWidth 2 BorderShadowDepth 1 ### But use no borders at all for these clients. NoBorder { # "WorkSpaceManager" "xclock" } # Make a resize cursor if the user points to the border. Kind of hard # with a 1 pixel border, though. Use with f.resize and bind it to a # button in frame context. BorderResizeCursors ### 3D effect on titles. Uncomment to use. UseThreeDTitles TitleShadowDepth 0 FramePadding 1 # Margin beetwen decorations and border in title. ### The window with focus with a decoration in the title bar. The ### default is a stipple pattern which is a pain over VNC. Above I ### have defined to use a small solid bitmap instead. If you don't ### want any such highlight, uncomment this. NoTitleHighlight # Mark focus with a sunken title bar if we have 3D titles. #SunkFocusWindowTitle ### Uncomment for tight titles squeezed to the left side. SqueezeTitle # Use no titles on windows whatsoever. Notitle ### If we turn on titles generally above, dont draw a title bar on ### top of these windows. Notitle { "WorkSpaceManager" "dclock" "xbiff" "bbmail" "xclock" "xeyes" "XMMS" } ### Put these windows on all workspaces. OccupyAll { "WorkSpaceManager" "dclock" "xclock" "rclock" "xbiff" "bbmail" "xeyes" "xmms" } ### I want transient windows to be able to occupy other workspaces ### than their parent window. Incidentally, this setting also makes ### f.occupy work on GTK programs. They seem to create an invisible ### parent window for some reason. Perhaps it's a bug? TransientHasOccupation ### No default buttons on title bar. NoDefaults ### The buttons on the title bar, sort of classic Macintosh-like with ### Close Window on the left and Zoom (vertical zoom, toggles, on ### first button, horizontal zoom on second and maximize on third) on ### the right. Years of refinement has told me that these are the ### functions I use the most, but, of course, you can see my TWM ### background from miles away. ### If you click anywhere else on the title bar, mouse button one ### moves the window, the middle raises or lowers the window and the ### third resizes. #LeftTitleButton ":dot" { LeftTitleButton ":xpm:bar" { Button1: f.delete Button2: f.destroy } #RightTitleButton ":resize" { RightTitleButton ":xpm:zoom" { Button1: f.zoom Button2: f.hzoom Button3: f.fullzoom } #TitleButtonBorderWidth 1 ButtonIndent 0 ### If we're using 3D buttons, use a 0 pixel shadow, for a flat look. TitleButtonShadowDepth 0 # Start resizing right away. #AutoRelativeResize MovePackResistance 20 ### The menus on the root window. Button1 = : root : f.menu "defops" ### The TwmIcons menu is only available in ctwm versions >=3.5.2, but ### very useful when its there. It shows a list of iconified windows ### so there is no need for mapped icon managers. Button2 = : root : f.menu "TwmIcons" Button3 = : root : f.menu "programs" ### If you can't run ctwm >= 3.5.2 for some reason, you will have to ### make do with the TwmWindows menu. Uncomment below. # Button3 = : root : f.menu "TwmWindows" ### Mouse button events on the title and in the window, when you ### simultaneously press mod1, which is the Alt key in my case. Check ### your xmodmap. Otherwise, the below mouse buttons work the way you ### expect on the title bar. ### Move window with left button, raise or lower with middle and zoom ### vertically with the rightmost button. Button1 = : title : f.movepack Button2 = : title : f.raiselower Button3 = : title : f.resize Button1 = : frame : f.resize Button1 = mod1 : window : f.movepack Button2 = mod1 : window : f.raiselower Button3 = mod1 : window : f.resize ### Not really used, since I have no icons visible. Button1 = : icon : f.function "move-or-iconify" Button2 = : icon : f.iconify Button1 = : iconmgr : f.iconify Button2 = : iconmgr : f.iconify ### Move visible screen to a different workspaces with the Function ### keys and a combination of arrow keys and ALT. "F1" = : all : f.gotoworkspace "1" "F2" = : all : f.gotoworkspace "2" "F3" = : all : f.gotoworkspace "3" "F4" = : all : f.gotoworkspace "4" "F5" = : all : f.gotoworkspace "5" "F6" = : all : f.gotoworkspace "6" "F7" = : all : f.gotoworkspace "7" "F8" = : all : f.gotoworkspace "8" "F9" = : all : f.gotoworkspace "9" "F10" = : all : f.gotoworkspace "10" ### Move windows about with Super and arrow keys. I have Super bound ### to the otherwise useless 'Windows' key on modern day PC keyboards. "Up" = mod3 : all : f.jumpup "20" "Left" = mod3 : all : f.jumpleft "20" "Right" = mod3 : all: f.jumpright "20" "Down" = mod3 : all : f.jumpdown "20" ### Maximize a window vertically with S-i. "i" = mod3 : all: f.zoom ### Maximize a window S-m. "m" = mod3 : all: f.fullzoom ### Kill a window with S-M-k. "k" = mod1 | mod3 : all: f.delete ### Program shortcuts. "t" = mod3 : all: f.exec "xterm -title 'xterm' &" ### Move around focus on current workspace with Meta and arrow keys. WindowRing WarpRingOnScreen WindowRingExclude { "WorkSpaceManager" "xbiff" "dclock" "xclock" "bbmail" } "Left" = mod1 : all : f.warpring "prev" "Right" = mod1 : all: f.warpring "next" ### And a menu with the usual window manager things, in case you need ### them. menu "defops" { "CTWM" f.title "Hide" f.iconify "Hidden" f.menu "TwmIcons" "Resize" f.resize "Move" f.movepack "Raise" f.raise "Lower" f.lower "Zoom" f.zoom "" f.nop "Focus" f.focus "Unfocus" f.unfocus "" f.nop "Occupy" f.occupy "" f.nop "Kill" f.destroy "Delete" f.delete "" f.nop "Restart" f.restart "" f.nop "Exit" f.quit } ### Some useful tools I often start. menu "programs" { "Programs" f.title "Terminal" f.exec "xterm -title 'localhost' &" "Emacs" f.exec "emacs &" "Firefox" f.exec "firefox&" } #...and no more.