# # .ctwmrc # Config variables in alphabetical order, for the most part :) # I like greyish colors because they are easy on the eyes # You may not like the color scheme at all, though it's rather easy to # change # I also don't like 3D stuff which I consider to be fluff :) # I set some of the X resources for rxvt, xload, etc. in .Xdefaults # # # all the m4 macros are defined here # these macros allow the dynamic sizing of configuration variables # define(workspace_offset,eval(HEIGHT/5)) define(border_width_pixels,eval(WIDTH/200)) define(small_font,ifelse(eval(WIDTH<=800),1,100,eval(WIDTH<=1280),1,120,eval(WIDTH>1280),1,140)) define(icon_manager_size,translit(eval(WIDTH/10*9).eval(HEIGHT/8),.,x)) define(icon_region_size,translit(eval(WIDTH/12).eval(HEIGHT/4*3),.,x)) define(icon_region_grid_width,eval(WIDTH/12)) define(icon_region_grid_height,eval(WIDTH/30)) define(max_size,translit(WIDTH.HEIGHT,.,x)) define(large_font,ifelse(eval(WIDTH<=800),1,120,eval(WIDTH<=1280),1,140,eval(WIDTH>1280),1,140)) define(move_delta_pixels,eval(WIDTH/120)) define(move_resistance,eval(WIDTH/40)) define(title_shadow_depth_pixels,eval(WIDTH/400)) define(workspace_size_s4,translit(eval(WIDTH/15).eval(HEIGHT/15),.,x)) define(workspace_size_h4,translit(eval(WIDTH/30).eval(HEIGHT/30),.,x)) define(workspace_size_v4,translit(eval(WIDTH/30).eval(HEIGHT/7),.,x)) define(workspace_size_v6,translit(eval(WIDTH/30).eval(HEIGHT/5),.,x)) define(rxvt_size,ifelse(eval(WIDTH<=640),1,80x25,eval(WIDTH<=800),1,80x30,eval(WIDTH<=1152),1,80x35,eval(WIDTH<=1280),1,80x40,1,eval(WIDTH>1280),80x45)) define(rxvt_font,ifelse(eval(WIDTH<=640),1,7x14,eval(WIDTH<=800),1,8x16,eval(WIDTH>800),1,10x20)) define(netscape_size,translit(eval(WIDTH/10*9).eval(HEIGHT/10*9),.,x)) define(gv_size,translit(eval(HEIGHT/10*8).eval(HEIGHT/10*9),.,x)) define(xclock_size,translit(eval(WIDTH/15).eval(WIDTH/15),.,x)) define(xbiff_offset,eval((HEIGHT/15+4)+eval((WIDTH/15+2)*2))) define(xload_offset,eval(HEIGHT/15+4)) define(xclock_offset,eval((HEIGHT/15+4)+eval(WIDTH/15+2))) # # windows in this list are never obscured by other windows # I have commented most things out, I got sick of them not being obscured # :) # AlwaysOnTop { "WorkSpaceManager" #"TWM Icon Manager" #"xclock" #"xload" "oclock" "xbiff" #"console" #"XLogo" } # AlwaysShowWindowWhenMovingFromWorkspaceManager AutoFocusToTransients # for pop-up windows, they always get focus # AutoRaise # windows will be raised when cursor enters, see RaiseDelay # AutoRelativeSize # # only show title bar for windows in this list unless cursor enters # them, useful for windows you want access to but don't want them to # take up screen space when not in use # AutoSqueeze { "workman" "xcdplayer" } # BeNiceToColormap # for 3D, use stipling instead of allocating new colors BorderResizeCursors # if uncommented, see below for button binding # BorderShadowDepth border_width_pixels # enable for 3D borders, see UseThreeDBorders BorderWidth border_width_pixels ButtonIndent 1 CenterFeedbackWindow # the sizing info will be in the middle of screen when resizing # ClientBorderWidth # # setup all the colors # look at file rgb.txt for the names of colors # most likely found here /usr/X11R6/lib/X11/rgb.txt # Color { BorderColor "SlateGrey" BorderTileBackground "grey20" BorderTileForeground "grey20" DefaultBackground "black" DefaultForeground "NavajoWhite" IconBackground "DarkSlateGrey" IconBorderColor "DarkBlue" IconForeground "wheat" IconManagerBackground "DarkSlateGrey" IconManagerForeground "NavajoWhite" IconManagerHighlight "red" # MapWindowBackground "color" [ { win_list } ] # MapWindowCurrentWorkSpace "border" [ "background" ] [ "foreground" ] # MapWindowDefaultWorkSpace "border" [ "background" ] [ "foreground" ] # MapWindowForeground "color" [ { win_list } ] MenuBackground "DarkSlateGrey" MenuForeground "NavajoWhite" MenuShadowColor "SlateGrey" MenuTitleBackground "SlateGrey" MenuTitleForeground "green" TitleBackground "black" TitleForeground "NavajoWhite" } # # look at file cursorfont.h for the different cursors, leave off XC_; # file will be in the X11 include directory # Cursors { Button "hand1" Destroy "pirate" # default Frame "left_ptr" Icon "center_ptr" IconMgr "left_ptr" Menu "sb_left_arrow" # default Move "fleur" # default Resize "sizing" Select "crosshair" Title "top_left_arrow" # default Wait "watch" # default } # DecorateTransients # pop-ups have title bar if uncommented DontMoveOff # windows will not move off screen, see MoveOffResistance # DontPaintRootWindow # useful if you use xv to set the background to an image # DontWarpCursorInWMap # when clicking in workspace cursor won't warp to window FramePadding 0 # distance between title bar items IconBorderWidth 1 IconFont "-adobe-helvetica-medium-r-normal--*-small_font-*-*-*-*-*-*" # # these windows will not show up in the icon manager # IconManagerDontShow { "TWM Icon Manager" "WorkSpaceManager" "xclock" "xload" "oclock" "xbiff" "xconsole" "console" "XLogo" } IconManagerFont "-adobe-helvetica-medium-r-normal--*-large_font-*-*-*-*-*-*" # IconManagerGeometry "icon_manager_size+2-2" IconManagerGeometry "icon_manager_size+2-2" 6 # IconManagerShadowDepth border_width_pixels # enable for 3D icon manager, see UseThreeDIconManagers IconRegion "icon_region_size+2+workspace_offset" North West icon_region_grid_width icon_region_grid_height "left" "left" "top" # IconRegionAlignment "top" # IconRegionJustification "left" # Icons { } MaxIconTitleWidth icon_region_grid_width # keeps the icon caption within the icon region MaxWindowSize "max_size" MenuFont "-adobe-helvetica-medium-r-normal--*-large_font-*-*-*-*-*-*" # MenuFont "-adobe-courier-medium-r-normal--*-large_font-*-*-*-*-*-*" # MenuShadowDepth border_width_pixels # enable for 3D menus, see UseThreeDMenus MoveDelta move_delta_pixels # number of pixels before the move begins when using f.move MoveOffResistance move_resistance # windows will move off if you go past so many pixels off the edge MovePackResistance move_resistance # windows will overlap for f.movepack if you go more than this many pixels # # these windows will not have borders # NoBorder { "TWM Icon Manager" "WorkSpaceManager" "xclock" "xload" "oclock" "xbiff" "xconsole" "console" "XLogo" } NoDefaults # comment out if you want default buttons in title bar NoGrabServer # # borders of these windows will not be highlighted, somewhat redundant # given the above list # NoHighlight { "TWM Icon Manager" "WorkSpaceManager" "xclock" "xload" "oclock" "xbiff" "XLogo" } # NoIconManagerFocus # focus won't be set to corresponding window when in IconManager NoMenuShadows # menus don't have shadows, looks cleaner # NoRaiseOnDeiconify NoRaiseOnMove # windows can slide under each other without being raised NoRaiseOnResize # NoRaiseOnWarp NoShowOccupyAll # don't show windows in work map that are in OccupyAll # # these windows have no title bars, no need to manipulate them # NoTitle { "TWM Icon Manager" "WorkSpaceManager" "xclock" "xload" "oclock" "xbiff" "xconsole" "console" "XLogo" } NoTitleHighlight # title color will not change when cursor enters window # OpaqueMove # resource intensive # OpaqueMoveThreshold 25 # only do opaque move for windows that are less than 25% of main screen # OpaqueResize # even more resource intensive # OpaqueResizeThreshold 20 PackNewWindows # try not to overlap windows, see MovePackResistance PixmapDirectory "HOME/bitmaps" # let's ctwm start up faster # RaiseDelay 50 # length of time before window is raised, see AutoRaise RaiseOnClick # clicking in a window will raise it RaiseOnClickButton 1 # left mouse button raises windows RaiseWhenAutoUnsqueeze # companion to AutoSqueeze RandomPlacement "on" # windows don't need to be placed with the mouse ReallyMoveInWorkspaceManager # windows can be moved in map window ResizeFont "-adobe-helvetica-medium-r-normal--*-large_font-*-*-*-*-*-*" RestartPreviousState ReverseCurrentWorkspace # window colors in workspace that's active will be reversed ShowIconManager # icon manager will be on the desktop ShowWorkSpaceManager # work space manager will be on the desktop # SchrinkIconTitles # I don't quite get this one # SqueezeTitle # title bars will be minimum width - kind of neat StartInMapState # use maps not buttons for WorkSpaces StayUpMenus # menus will stay on screen after button release # SunkFocusWindowTitle # enable for 3D titles, see UseThreeDTitles # ThreeDBorderWidth border_width_pixels # enable for 3D borders, see UseThreeDBorders # TitleButtonBorderWidth 1 # enable for 3D titles, see UseThreeDTitles # TitleButtonShadowDepth 1 # enable for 3D titles, see UseThreeDTitles TitleFont "-misc-fixed-medium-r-normal--*-large_font-*-*-*-*-*-*" # TitleJustification "right" # default is "left" TitlePadding 1 # TitleShadowDepth title_shadow_depth_pixels # enable for 3D titles, see UseThreeDTitles TransientOnTop 50 # pop-up windows will be on top of their parent UsePPosition "nonzero" # ctwm will honor program requested positions # UseThreeDBorders # enable for 3D # UseThreeDIconManagers # enable for 3D # UseThreeDMenus # enable for 3D # UseThreeDTitles # enable for 3D # UseThreeDWMap # enable for 3D # WarpCursor # warp cursor into windows on deiconify WarpRingOnScreen # windows on screen can be warped to with f.warpring # # only put few things in the ring, with no braces the list is defaulted to # all windows on screen # WindowRing { "rxvt" "xterm" "Netscape" "gv" "xpdf" "xv" } # WorkSpaceManagerGeometry "workspace_size_s4+2+2" 2 # WorkSpaceManagerGeometry "workspace_size_h4+2+2" 4 # WorkSpaceManagerGeometry "workspace_size_v4+2+2" 1 WorkSpaceManagerGeometry "workspace_size_v6+2+2" 1 # # the virtual windows # I only make 6 but you could make more # WorkSpaces { "1" { "DarkBlue" "green4" "DarkSlateGrey" } "2" { "DarkBlue" "green4" "DarkSlateGrey" } "3" { "DarkBlue" "green4" "DarkSlateGrey" } "4" { "DarkBlue" "green4" "DarkSlateGrey" } "5" { "DarkBlue" "green4" "DarkSlateGrey" } "6" { "DarkBlue" "green4" "DarkSlateGrey" } } # # these windows will occupy all workspaces, they will show up in all the # virtual screens # OccupyAll { "xclock" "oclock" "xload" "xbiff" } Zoom 0 # outlines of the window are shown as it's minimized if it's non-zero # # setup some functions # Function "move-or-raiselower" { f.move f.deltastop f.raiselower } Function "move-or-iconify" { f.move f.deltastop f.iconify } Function "deiconify-and-squeeze" { f.deiconify f.squeeze } # ChangeWorkspaceFunction f.beep DefaultFunction f.beep # DeIconifyFunction f.nop # IconifyFunction f.nop # WindowFunction f.nop # # add buttons to title bar # I only like to have one button on each side # bind different actions to the buttons # LeftTitleButton ":xlogo" { Button1 : f.iconify Button2 : f.delete Button3 : f.menu "win" } RightTitleButton ":resize" { Button1 : f.resize Button2 : f.squeeze Button3 : f.fullzoom } # # bind the mouse button events # Button1 = : root : f.menu "clients" Button2 = : root : f.menu "ctwm" Button3 = : root : f.menu "win" Button1 = : title : f.function "move-or-raiselower" Button2 = : title : f.movepack Button3 = : title : f.squeeze Button1 = : icon | iconmgr : f.function "move-or-iconify" Button2 = : iconmgr : f.raiselower Button3 = : iconmgr : f.squeeze Button2 = : icon : f.deiconify Button3 = : icon : f.function "deiconify-and-squeeze" Button1 = : frame : f.resize # uncomment for BorderResizeCursors Button2 = : frame : f.move # uncomment if you want Button3 = : frame : f.move # uncomment if you want # # bind the control + mouse button events # Button1 = control : window | title | icon : f.move Button2 = control : window | title : f.movepack Button3 = control : window | title : f.squeeze Button2 = control : icon : f.deiconify Button3 = control : icon : f.function "deiconify-and-squeeze" # # bind the alt + mouse button events # Button1 = meta : title : f.menu "win" Button2 = meta : title : f.fullzoom Button3 = meta : title : f.squeeze Button1 = meta : window : f.menu "clients" Button2 = meta : window : f.menu "ctwm" Button3 = meta : window : f.menu "win" Button1 = meta : icon : f.move Button2 = meta : icon : f.deiconify Button3 = meta : icon : f.function "deiconify-and-squeeze" # # these menus are predefined by ctwm # Button1 = meta : root : f.menu "TwmWindows" Button2 = meta : root : f.menu "TwmWorkspaces" Button3 = meta : root : f.menu "TwmAllWindows" # # bind the function keys # "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.beep "F8" = : all : f.beep "F9" = : window | title | icon : f.ring "F10" = : all : f.beep "F11" = : all : f.beep "F12" = : all : f.beep # # bind the alt + function keys # mostly to accomodate my tendency to use alt + func keys with the virtual # terminals :) # "F1" = meta : all : f.gotoworkspace "1" "F2" = meta : all : f.gotoworkspace "2" "F3" = meta : all : f.gotoworkspace "3" "F4" = meta : all : f.gotoworkspace "4" "F5" = meta : all : f.gotoworkspace "5" "F6" = meta : all : f.gotoworkspace "6" "F7" = meta : all : f.beep "F8" = meta : all : f.beep "F9" = meta : all : f.beep "F10" = meta : all : f.beep "F11" = meta : all : f.beep "F12" = meta : all : f.beep # # bind the alt + key events # alt + c closes a window # alt + k kills a window that just won't die :) # "1" = meta : all : f.gotoworkspace "1" "2" = meta : all : f.gotoworkspace "2" "3" = meta : all : f.gotoworkspace "3" "4" = meta : all : f.gotoworkspace "4" "5" = meta : all : f.gotoworkspace "5" "6" = meta : all : f.gotoworkspace "6" "7" = meta : all : f.beep "8" = meta : all : f.beep "9" = meta : all : f.beep "0" = meta : all : f.beep # b e f j l o w x y "a" = meta : window | title : f.occupyall "c" = meta : window | title | icon : f.delete "d" = meta : all : f.circledown "g" = meta : all : f.warpto "XTerm" "h" = meta : window | title : f.hzoom "i" = meta : window | title | icon : f.iconify "k" = meta : window | title | icon : f.destroy "m" = meta : all : f.menu "clients" "n" = meta : all : f.warpring "prev" "p" = meta : all : f.warpring "next" "q" = meta : all : f.menu "quit" "r" = meta : window | title : f.raiselower "s" = meta : window | title | iconmgr : f.squeeze "t" = meta : all : ! "rxvt -geometry rxvt_size+45+5 &" "u" = meta : all : f.circleup "v" = meta : window | title : f.zoom "z" = meta : window | title : f.fullzoom # alternate key bindings "Return" = meta : all : f.altkeymap "1" "n" = a1 : all : f.nextworkspace "p" = a1 : all : f.prevworkspace "r" = a1 : window | title | icon : f.ring "m" = a1 : all : f.menu "win" # # bind the alt + cursor keys events # # "Right" = meta : all : f.forwiconmgr # "Left" = meta : all : f.backiconmgr "Up" = meta : all : f.forwmapiconmgr "Down" = meta : all : f.backmapiconmgr # # set up some nice menus # they have already been bound to keys above as well as mouse buttons # Menu "browsers" { "browsers" f.title "netscape" ! "MOZILLA_HOME=/usr/local/netscape /usr/local/netscape/netscape -geometry netscape_size &" "lynx" ! "rxvt -geometry rxvt_size -fn rxvt_font -title lynx -e lynx -cookies vnode &" } Menu "clients" { "clients (Alt-M)" f.title "xterms" f.menu "xterms" "" f.separator "browsers" f.menu "browsers" "" f.separator "xviewers" f.menu "xviewers" "" f.separator "xutils" f.menu "xutils" } Menu "ctwm" { "ctwm" f.title "exit ctwm" f.quit "" f.separator "show iconmgr" f.showiconmgr "hide iconmgr" f.hideiconmgr "" f.separator "toggle map/button" f.togglestate "" f.separator "toggle workspacemgr" f.toggleworkspacemgr "" f.separator "refresh" f.refresh "restart" f.restart } Menu "font_small" { "small font" f.title "80x25-7x14b" ! "rxvt -geometry 80x25 -fn 7x14bold &" "80x35-7x14b" ! "rxvt -geometry 80x35 -fn 7x14bold &" "80x45-7x14b" ! "rxvt -geometry 80x45 -fn 7x14bold &" "132x45-7x14b" ! "rxvt -geometry 132x45 -fn 7x14bold &" } Menu "font_medium" { "medium font" f.title "80x25-8x16" ! "rxvt -geometry 80x25 -fn 8x16 &" "80x35-8x16" ! "rxvt -geometry 80x35 -fn 8x16 &" "80x45-8x16" ! "rxvt -geometry 80x45 -fn 8x16 &" "132x45-8x16" ! "rxvt -geometry 132x45 -fn 8x16 &" "" f.separator "80x25-9x15b" ! "rxvt -geometry 80x25 -fn 9x15bold &" "80x35-9x15b" ! "rxvt -geometry 80x35 -fn 9x15bold &" "80x45-9x15b" ! "rxvt -geometry 80x45 -fn 9x15bold &" "132x45-9x15b" ! "rxvt -geometry 132x45 -fn 9x15bold &" } Menu "font_large" { "large font" f.title "80x25-10x20" ! "rxvt -geometry 80x25 -fn 10x20 &" "80x35-10x20" ! "rxvt -geometry 80x35 -fn 10x20 &" "80x40-10x20" ! "rxvt -geometry 80x40 -fn 10x20 &" "80x45-10x20" ! "rxvt -geometry 80x45 -fn 10x20 &" } Menu "font_huge" { "huge font" f.title "80x25-12x24" ! "rxvt -geometry 80x25 -fn 12x24 &" "80x30-12x24" ! "rxvt -geometry 80x30 -fn 12x24 &" "80x35-12x24" ! "rxvt -geometry 80x35 -fn 12x24 &" } Menu "quit" { "Quit" f.quit "No" f.nop } Menu "xterm_misc" { "misc" f.title "console" ! "rxvt -geometry 80x8-2-2 -fn 7x14 -name console -C -sl 0 &" "xconsole" ! "xconsole &" } Menu "win" { "options" f.title "identify" f.identify "occupy ..." f.occupy "occupy all (Alt-A)" f.occupyall "winrefresh" f.winrefresh "save" f.saveyourself "auto raise" f.autoraise "add to ring (F9)" f.ring "" f.separator "fullzoom (Alt-Z)" f.fullzoom "hzoom (Alt-H)" f.hzoom "iconify (Alt-I)" f.iconify "move ..." f.move "movepack" f.movepack "raiselower (Alt-R)" f.raiselower "resize ..." f.resize "squeeze (Alt-S)" f.squeeze "vzoom (Alt-V)" f.zoom "initial size" f.initsize "" f.separator "focus" f.focus "unfocus" f.unfocus "circle down" f.circledown "circle up" f.circleup "" f.separator "close (Alt-C)" f.delete "kill (Alt-K)" f.destroy } Menu "xterms" { "xterms" f.title "rxvt_size-rxvt_font (Alt-T)" ! "rxvt -geometry rxvt_size -fn rxvt_font &" "" f.separator "small font" f.menu "font_small" "medium font" f.menu "font_medium" "large font" f.menu "font_large" "huge font" f.menu "font_huge" "misc" f.menu "xterm_misc" } Menu "xutils" { "xutils" f.title "calctool" ! "calctool &" "gvim" ! "gvim -geometry rxvt_size -fn rxvt_font &" "oclock" ! "oclock -geometry xclock_size-2+xclock_offset &" "workman" ! "workman -bd -c /dev/wcd0c &" "xbiff" ! "xbiff -geometry 48x48-2+xbiff_offset &" "xcalc" ! "xcalc &" "xcdplayer" ! "xcdplayer -device /dev/wcd0c &" "xclock" ! "xclock -geometry xclock_size-2+xclock_offset &" "xfig" ! "xfig &" "xfontsel" ! "xfontsel &" "xload" ! "xload -geometry xclock_size-2+xload_offset -nolabel -jumpscroll 1 -update 2 &" "xman" ! "xman &" } Menu "xviewers" { "xviewers" f.title "gv" ! "gv -geometry gv_size &" "xfig" ! "xfig -geometry netscape_size &" "xpdf" ! "xpdf -geometry gv_size &" "xv" ! "xv &" } # # that's it :) # # vim:ts=8 sts=8: