home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gwm18a.zip / data / vtwmrc.gwm < prev    next >
Lisp/Scheme  |  1995-07-03  |  26KB  |  589 lines

  1. ;; vtwmrc.gwm --- VTWM profile customizations
  2. ;;
  3. ;; Author: Anders Holst  (aho@sans.kth.se)  
  4. ;; Copyright (C) 1995  Anders Holst
  5. ;; Version: vtwm-1.0
  6. ;; Last change: 17/6 1995
  7. ;;
  8. ;; This file is copyrighted under the same terms as the rest of GWM
  9. ;; (see the X Inc license for details). There is no warranty that it
  10. ;; works. 
  11. ;;
  12. ;; --------------------------------------------------------------------- 
  13. ;;
  14. ;; This is an example of VTWM profile customizations. Plaese copy this
  15. ;; file to your own gwm-directory, and make the modifications you like.
  16. ;;
  17. ;; Some variables below are lists of "window types". These lists can 
  18. ;; contain one of four (actually six) different kinds of specifications:
  19. ;;   * An atom, representing a client class (like 'XTerm or 'Emacs).
  20. ;;   * A string, representing a regexp for the window name ("^login$").
  21. ;;   * A list which is a specification ala Jay Berkenbilt (as matched
  22. ;;     with 'match-windowspec')
  23. ;;   * An arbitrary WOOL expression, returning nil or non-nil.
  24. ;;  (* 't', which matches everything.)
  25. ;;  (* '()' which matches nothing.)
  26. ;;
  27.  
  28.  
  29. ;;=============================================================================
  30. ;;
  31. ;;        User settable variables
  32. ;;
  33. ;;=============================================================================
  34. ;;
  35. ;; Below are shown in comments all default settings of customizable
  36. ;; variables from the various components of the VTWM profile.
  37. ;;
  38.  
  39.  
  40. ;;=============================================================================
  41. ;;        General VTWM variables
  42. ;;=============================================================================
  43. ;;
  44. ;;       screen-tile ()         ; Pixmap for screen background tiling
  45. ;;       root-cursor ()         ; Form of root cursor
  46. ;;       autoraise ()           ; Raise windows when entered
  47. ;;       autocolormap t         ; Change colormap to that of the entered window
  48. ;;       autofocus t            ; Set focus to entered window
  49. ;;       place-randomly t       ; Place windows pseudo randomly,and not by user
  50. ;;       raise-on-move ()       ; Raise windows when they are moved
  51. ;;       raise-on-resize ()     ; Raise windows when they are resized
  52. ;;       raise-on-iconify ()    ; Raise windows (or icons) when iconifying
  53.  
  54. (setq root-cursor (cursor-make 68))
  55. (setq autoraise ())
  56. (setq place-randomly t)
  57. (setq raise-on-move t)
  58. (setq raise-on-resize t) 
  59. (setq raise-on-iconify ())
  60.  
  61. ;;=============================================================================
  62. ;;        VTWM Window and Icon variables
  63. ;;=============================================================================
  64. ;;
  65. ;;       vtwm-borderwidth 2             ; Borderwidth of most windows
  66. ;;       vtwm-bordercolor black         ; Color of border (inactive window)
  67. ;;       vtwm-active-bordercolor white  ; Color of active window border
  68. ;;       vtwm-title-background white    ; Default background of titlebar
  69. ;;       vtwm-title-foreground black    ; Default foreground of titlebar
  70. ;;       vtwm-title-font (font-make "9x15")   ; Font in titlebar
  71. ;;       vtwm-icon-foreground black     ; Default background of icons
  72. ;;       vtwm-icon-background white     ; Default foreground of icons
  73. ;;       vtwm-fancy-colors ()           
  74. ;;          ; List of '(window-type foreground background)' specifications.
  75. ;;       vtwm-notitle-list '(Gwm (window-is-transient-for))
  76. ;;          ; List of window types to make untitled
  77. ;;       default-icon-pixmap-name ()    ; Pixmap filename for default icon
  78. ;;       hilite-pixmap-name "gray"      ; Filename for active titlebar pattern
  79. ;;       vtwm-left-plugs '(("iconify2" (iconify-window)))
  80. ;;       vtwm-right-plugs '(("resize2" (twm-resize-window) t))
  81. ;;           ; Left and right plugs in the titlebar, a list of pairs
  82. ;;           ; or tripplets:  ( <pixmap-file> <action> [<on-press>] )
  83. ;;           ; The optional third element <on-press> signals that the action
  84. ;;           ; should be run on button-press, rather than button-release.
  85.  
  86. (setq vtwm-notitle-list '(XLoad XClock XBiff Gwm (window-is-transient-for)))
  87. (setq vtwm-bordercolor black)
  88. (setq vtwm-active-bordercolor black)
  89. (if (= screen-type 'color)
  90.   (progn 
  91.     (setq vtwm-title-foreground  white)
  92.     (setq vtwm-title-background  (color-make "royalblue"))
  93.     (setq vtwm-icon-foreground  (color-make "darkslategray"))
  94.     (setq vtwm-icon-background  (color-make "green"))
  95.     ;; Example of how to use vtwm-fancy-colors. Windows called "su" or
  96.     ;; "ksu" get red titlebars with black text, and (other) xterms get
  97.     ;; green titlebars with white (= vtwm-title-foreground above) text.
  98.     ;(setq vtwm-fancy-colors (list
  99.     ;                         (list "^k*su$" black (color-make "red"))
  100.     ;                         (list 'XTerm () (color-make "seagreen")))
  101.     ))
  102.  
  103. ;; Example of how to get a menu-plug to the left and a zoom-plug to the right
  104. ; (setq vtwm-left-plugs '(("iconify2" (iconify-window))
  105. ;                         ("menu" (vtwm-pop-menu window-pop) t)))
  106. ; (setq vtwm-right-plugs '(("zoom" (zoom-window))
  107. ;                          ("resize2" (twm-resize-window) t)))
  108.  
  109. ;; Note that you can also get "squeezed title" windows ala TWM, if you
  110. ;; use either "vtwm-squeezed-window.gwm" or "vtwm-squeezed-window2.gwm".
  111. ;; Use 'set-window' to specify which windows you want squeezed titles on:
  112. ; (set-window Emacs vtwm-squeezed-window2)
  113.  
  114.  
  115. ;;=============================================================================
  116. ;;        VTWM Zoom functions
  117. ;;=============================================================================
  118. ;;
  119. ;;       zoom-offset 3                  ; Minimum distance to screen edge
  120. ;;       zoom-window-method-list ()     ; List of (wind-type zoom-func) specs.
  121. ;;          ; This is to make zoom-window use different zoom methods for
  122. ;;          ; different types of windows.
  123.  
  124. (setq zoom-window-method-list '((XTerm zoom-window-vert) 
  125.                                 (XVroot zoom-window-prop)
  126.                                 (t zoom-window-full)))
  127.  
  128.  
  129. ;;=============================================================================
  130. ;;        VTWM Menu appearance
  131. ;;=============================================================================
  132. ;;
  133. ;;       vtwm-menu-foreground black     ; Foreground of menus
  134. ;;       vtwm-menu-background white     ; Background of menus
  135. ;;       vtwm-menu-border-color black   ; Border color of menus
  136. ;;       vtwm-menu-label-foreground vtwm-menu-foreground 
  137. ;;       vtwm-menu-label-background vtwm-menu-background
  138. ;;       vtwm-menu-hilite-border black  ; Border of the current menu item
  139. ;;       vtwm-menu-shadow t             ; Whether the menu has a shadow
  140. ;;       vtwm-menu-shadow-color black   ; Color of shadow
  141. ;;       vtwm-menu-shadow-offset 6      ; Offset of shadow from menu
  142. ;;       vtwm-menu-font (font-make "8x13")     ; Menu item font
  143. ;;       vtwm-menu-label-font vtwm-menu-font   ; Menu label font
  144. ;;       vtwm-menu-item-height 10       ; Minimum height of an item
  145. ;;       vtwm-menu-min-width 100        ; Minimum width of menu
  146.  
  147. (setq vtwm-menu-foreground black)
  148. (setq vtwm-menu-background (color-make "pink"))
  149. (setq vtwm-menu-label-background (color-make "palevioletred"))
  150. (setq vtwm-menu-hilite-border black)
  151. (setq vtwm-menu-shadow-color black)
  152. (setq vtwm-menu-border-color black)
  153. (setq vtwm-menu-font 
  154.       (font-make "*-helvetica-medium-o-normal-*-140-*"))
  155. (setq vtwm-menu-label-font 
  156.       (font-make "*-times-bold-i-normal-*-180-*"))
  157.  
  158.  
  159. ;;=============================================================================
  160. ;;        Icon Manager variables
  161. ;;=============================================================================
  162. ;;
  163. ;;       icon-mgr-name "Icon Manager"   ; Default name of icon manager
  164. ;;       icon-mgr-xpos 0                ; Default x position
  165. ;;       icon-mgr-ypos 0                ; Default y position
  166. ;;       show-default-icon-mgr t        ; Default icon manager is used
  167. ;;       show-icon-mgr t                ; Use icon managers
  168. ;;       icon-mgr-hide-if-empty t       ; Don't show empty managers
  169. ;;       iconify-by-unmapping t         ; Do not use icons by default
  170. ;;       iconify-unmanaged-by-icon t    ; Use an icon if not in any manager
  171. ;;       iconify-by-icon-list ()        ; Always use icons for these
  172. ;;       iconify-on-start-list () ; List of window types to iconify on start
  173. ;;       icon-mgr-omit-list ()    ; Window types not handled in default manager
  174. ;;       icon-mgr-sort ()               ; Sort the entries in an icon manager
  175. ;;       icon-mgr-font (font-make "8x13")   ; Font in icon managers
  176. ;;       icon-mgr-width 150             ; Width of icon manager
  177. ;;       icon-mgr-foreground black      ; Foreground of icon managers
  178. ;;       icon-mgr-background white      ; Background of icon managers
  179. ;;       icon-mgr-title-foreground icon-mgr-foreground
  180. ;;       icon-mgr-title-background icon-mgr-background
  181. ;;       icon-mgr-no-title ()           ; Inhibits the icon manager title
  182. ;;       icon-mgr-framed-bars ()        ; Makes it look more like in real VTWM
  183. ;;       icon-mgr-fancy-colors ()       ; List of (wintype fg bg) specifications
  184. ;;       icon-mgr-window-feedback t     ; Rely on focus feedback from windows
  185. ;;       icon-mgr-pixmap-name "iconify2"; Pixmap file for iconified symbol
  186. ;;         ; In addition, the property 'icon-mgr-special-pixmap can be set on
  187. ;;         ; a window to the pixmap to use for that window in the icon manager.
  188.  
  189. (if (not (= screen-type 'color))
  190.     (progn 
  191.       (setq icon-mgr-foreground black)
  192.       (setq icon-mgr-background white))
  193.   (progn 
  194.     (setq icon-mgr-foreground  black)
  195.     (setq icon-mgr-background  (color-make "tan"))
  196.     (setq icon-mgr-title-background (color-make "peru"))))
  197. (setq show-icon-mgr t) 
  198. (setq icon-mgr-sort t)        
  199. (setq iconify-by-unmapping t)
  200. (setq iconify-on-start-list '(XConsole "^gwmchat$"))
  201. (setq icon-mgr-omit-list
  202.       '(XLoad XClock XBiff Gwm (window-is-transient-for)))
  203. (setq icon-mgr-xpos -6)
  204. (setq icon-mgr-ypos 6)                   
  205. (setq icon-mgr-width 150)    
  206. (setq icon-mgr-font (font-make "8x13"))
  207. ;; If you use multiple icon managers, this might look better:
  208. ; (setq icon-mgr-width 120)
  209. ; (setq icon-mgr-font (font-make "6x13"))
  210.  
  211.  
  212. ;;=============================================================================
  213. ;;        Virtual Screen
  214. ;;=============================================================================
  215. ;;
  216. ;;       show-virtual t                 ; Show the map of the virtual screen
  217. ;;       virtual-modifiers (together with-control with-alt) 
  218. ;;                                      ; Modifiers for arrow keys
  219. ;;       virtual-omit-nailed t          ; Show only non-nailed windows in map
  220. ;;       virtual-omit-list ()           ; List of window types not shown in map
  221. ;;       virtual-show-filled t          ; Draw windows filled in map
  222. ;;       virtual-fancy-colors ()        
  223. ;;           ; list of (window-type foreground background) specifications
  224. ;;       virtual-xpos 0                 ; Original position of map
  225. ;;       virtual-ypos 0                 ;  - '' -  
  226. ;;       virtual-pixsize 160            ; Size of the map
  227. ;;       virtual-background white       ; Default background of the map
  228. ;;       virtual-foreground black       ; Default window frame color in the map
  229. ;;       virtual-horizontal-step (/ screen-width 2)  ; Amount to move by keys
  230. ;;       virtual-vertical-step (/ screen-height 2)
  231. ;;       virtual-nailed-list '(Gwm)     ; Initially nailed windows
  232.  
  233. (setq virtual-xpos -166)
  234. (setq virtual-ypos 6)
  235. (setq virtual-pixsize 150)
  236. (setq virtual-nailed-list '(XLoad XClock XBiff XConsole Gwm "^gwmchat$"))
  237. (setq virtual-omit-list '(XLoad XClock XBiff Gwm))
  238. (setq virtual-omit-nailed ())
  239. (setq virtual-modifiers with-alt)
  240. (if (= screen-type 'color)
  241.   (progn 
  242.     (setq virtual-background (color-make "lightyellow"))
  243.     (setq virtual-foreground black)
  244.     (setq virtual-show-filled t)
  245.     (setq virtual-fancy-colors (list
  246.                                 (list () (color-make "lightgray"))
  247.                                 ; (list 'XTerm () (color-make "lightskyblue"))
  248.                                 ; (list 'Emacs () (color-make "lightpink"))
  249.                                 (list t () white)))
  250. ))
  251.  
  252.  
  253. ;;=============================================================================
  254. ;;        Virtual Door variables
  255. ;;=============================================================================
  256. ;;
  257. ;;       door-font (font-make "8x13")   ; Font in door buttons
  258. ;;       door-background white          ; Background color of door buttons
  259. ;;       door-foreground black          ; Foreground color of door buttons
  260. ;;       door-borderwidth 2             ; Border width of door buttons
  261. ;;       door-xsize 90                  ; Door button size
  262. ;;       door-ysize 16                  ;  - '' -
  263. ;;       door-mgr-dir-horiz t    ; Controls mapping of doors on virtual screen,
  264. ;;       door-mgr-dir-len 2      ; e.g. two screenfulls in a (horizontal) row.
  265. ;;       door-mgr-mdir-horiz t   ; Controls position of door buttons, e.g. 
  266. ;;       door-mgr-mdir-len 2     ; place two buttons in each (horizontal) row.
  267. ;;       door-mgr-xpos 0                ; Upper left corner of door manager
  268. ;;       door-mgr-ypos 0                ;  - '' -
  269. ;;       door-mgr-tile t         ; tile of empty positions, t = transparent 
  270. ;;
  271.  
  272. (setq door-mgr-xpos 4)
  273. (setq door-mgr-ypos 4)
  274. (if (= screen-type 'color)
  275.   (progn 
  276.     (setq door-background (color-make "lightyellow"))
  277.     (setq door-foreground black)
  278. ))
  279.  
  280.  
  281. ;;=============================================================================
  282. ;;        Virtual Panlist variables
  283. ;;=============================================================================
  284. ;;
  285. ;;       show-pan-lists t               ; Enable pan lists
  286. ;;       pan-on-click ()                ; Pan on click (i.e. when you click
  287. ;;          ; in an edge or corner of the screen), or on enter (i.e. autopan, 
  288. ;;          ; pan as soon as the cursor reaches the edge of the screen).
  289. ;;       pan-x-step (/ screen-width 4)  ; How much to pan (when autopanning)
  290. ;;       pan-y-step (/ screen-height 4) ;  - '' -
  291.  
  292. (setq show-pan-lists t)
  293. (setq pan-on-click t)
  294.  
  295.  
  296. ;;=============================================================================
  297. ;;
  298. ;;        Definition of menus
  299. ;;
  300. ;;=============================================================================
  301. ;;
  302. ;; To define a menu, you can use the following constructors:
  303. ;; 
  304. ;;   (construct-menu ENTRY ...)
  305. ;;
  306. ;;   (construct-window-menu NAME ACTION)
  307. ;;   (construct-window-menu-items WINDOW-TYPE ACTION)
  308. ;;
  309. ;;   (construct-machine-menu NAME MACHINE-LIST ACTION)
  310. ;;   (construct-machine-menu-items MACHINE-LIST ACTION)
  311. ;;   (construct-xrsh-menu MACHINE-LIST COMMAND)
  312. ;;
  313. ;; There are examples on how to use most of them below, and more
  314. ;; thorough documentation can be found in "vtwm-menu.gwm".
  315. ;;
  316. ;; Below you can first define a set of useful variables and functions
  317. ;; for use when constructing menus. Thereafter you construct all the
  318. ;; menus you need. These can in turn be used in the behaviors defined
  319. ;; furter down.
  320.  
  321. ;;=============================================================================
  322. ;;        Variables to use when constructing menus
  323. ;;=============================================================================
  324.  
  325. ;; Put the often used machines in this list, "computer.some.whe.re"
  326. (setq machine-list (list 
  327.                          ))
  328.  
  329. ;; Put here machines that are not in the same domain, and thus need password
  330. (setq telnet-machine-list (list 
  331.                                 ))
  332.  
  333. ;; Remove the local host from machine-list, it will be added to the menu anyway
  334. (with (mem (member hostname machine-list))
  335.   (if mem
  336.       (delete-nth mem machine-list)))
  337.  
  338.  
  339. ;;=============================================================================
  340. ;;        Construction of menus
  341. ;;=============================================================================
  342.  
  343. ;; Menu with useful global commands
  344. (setq root-pop (construct-menu
  345.                 "Root Options"
  346.                 '("Refresh" (refresh))
  347.                 '("Sleep" (sleep-now))
  348.                 '("Exec cut" 
  349.                   (execute-string (+ "(? " cut-buffer ")")))
  350.                 '("Redecorate" (redecorate-all))
  351.                 '("Deiconify all" (deiconify-all))
  352.                 '("Unfocus" (focus-window))
  353.                 ;; How to let the user pick a window to do something with
  354.                 ; '("Kill" (kill-picked))
  355.                 ; '("Client Info" (with-picked
  356.                 ;                   (? "Window: " (window-client-class) "."
  357.                 ;                      (window-client-name) "."
  358.                 ;                      (window-name) "@"
  359.                 ;                      (window-machine-name) "\n")))
  360.                 '("Toggle IconMgr" (icon-mgr-toggle))
  361.                 '("Toggle Virtual" (virtual-toggle))
  362.                 '("Restart" (restart))
  363.                 '("Reload" (progn
  364.                              (load "vtwmrc")
  365.                              (redecorate-all)))
  366.                 '("Quit" (end))))
  367.  
  368. ;; Menu with useful window commands (and some global)
  369. (setq window-pop (construct-menu
  370.                   "Window Options"    
  371.                   '("Raise" (raise-window))
  372.                   '("Lower" (lower-window))
  373.                   '("Resize" (twm-resize-window))
  374.                   '("Move" (move-window))
  375.                   '("Iconify" (toggle-iconify-window))
  376.                   '("Zoom" (zoom-window))
  377.                   '("Nail" (virtual-toggle-nail))
  378.                   '("Focus" (focus-window))
  379.                   '("Refresh" (refresh window))
  380.                   '("Kill" (or (delete-window) (kill-window)))
  381.                   '("Exec cut" 
  382.                     (execute-string (+ "(? " cut-buffer ")")))
  383.                   '("Redecorate" (re-decorate-window))
  384.                   '("Client Info" 
  385.                     (? "Window: " (window-client-class) "."
  386.                        (window-client-name) "."
  387.                        (window-name) "@"
  388.                        (window-machine-name) "\n"))
  389.                   '("Geometry" 
  390.                     (? "Geometry:" window-width "x"
  391.                        window-height "+"
  392.                        window-x "+"
  393.                        window-y "\n"))
  394.                   '("Restart" (restart))
  395.                   '("Reload" (progn
  396.                                (load "vtwmrc")
  397.                                (redecorate-all)))
  398.                   '("Quit" (end))))
  399.  
  400. ;; Menu to log in to other machines. First comes the local host, then
  401. ;; all host you can log in to with "rsh" (in machine-list), and then
  402. ;; those you need to give an additional password (in telnet-machine-list).
  403. (setq login-pop (construct-menu
  404.                  "Logins"
  405.                  (construct-machine-menu-items (list hostname)
  406.                             ; This is to get around a bug that turns up
  407.                             ; when gwmchat and bash is used together
  408.                             (if (match "bash$" (getenv "SHELL"))
  409.                                 (+ '(! "xterm" "-T" name "-e" "csh" "-c")
  410.                                    (list (getenv "SHELL")))
  411.                               '(! "xterm" "-n" name)))
  412.                  (construct-machine-menu-items machine-list
  413.                             '(! "xlogin" host "-n" name))
  414.                  (construct-machine-menu-items telnet-machine-list
  415.                             '(! "xterm" "-T" name "-e" "telnet" host))))
  416. ;; Examples of simpler alternatives for the same thing:
  417. ; (setq login-pop (construct-xrsh-menu machine-list "xterm"))
  418. ; (setq login-pop (construct-machine-menu "Logins" machine-list
  419. ;                                         '(! "xlogin" host)))
  420.  
  421. ;; Menu for starting xload
  422. (setq xload-pop (construct-xrsh-menu machine-list "xload"))
  423.  
  424. ;; Menu for starting emacs
  425. (setq emacs-pop (construct-xrsh-menu machine-list
  426.                 '("emacs" "-name" (+ name "-Emacs") "-geometry" "85x50")))
  427. ;; Example of simpler alternative:
  428. ; (setq emacs-pop (construct-xrsh-menu machine-list "emacs"))
  429.  
  430. ;; Auxilary function and menu for starting an xterm, an emacs and an xload
  431. ;; on some machine, in a fresh area on the virtual screen.
  432. (defun remote-start (host name)
  433.   (maybe-add-door name 'free)
  434.   (goto-door name)
  435.   (xrsh-command host (list "xterm" "-n" name
  436.                       "-geometry" (virtual-coord-string 20 60)))
  437.   (xrsh-command host (list "emacs" "-name" (+ name "-Emacs")
  438.                       "-geometry" (+ "164x55" (virtual-coord-string 10 110))))
  439.   (xrsh-command host (list "xload")))
  440.  
  441. (setq start-pop (construct-machine-menu "Start all" machine-list 
  442.                                         '(remote-start host name)))
  443.  
  444. ;; If you rather want one menu with several commands (to run on the
  445. ;; local host), then you can do something like this:
  446. ; (setq command-pop (construct-menu
  447. ;                    "Command"
  448. ;                    '("Xterm" (! "xterm" "-n" (machine-name hostname)))
  449. ;                    '("Emacs" (! "emacs" "-name" 
  450. ;                                (+ (machine-name hostname) "-Emacs")
  451. ;                                "-geometry" "85x50"))
  452. ;                    '("Xload" (! "xload"))
  453. ;                    '("All" (remote-start hostname (machine-name hostname)))
  454. ;                    '("Calc" (! "xcalc"))
  455. ;                    '("Lock" (! "xnlock" "-rv"))))
  456.  
  457. ;; Function to create a windows menu which pops to (i.e. scrolls to, 
  458. ;; deiconifies, and raises) the selected window. It is a function, so
  459. ;; that the menu can be rebuilt with the current windows every time it
  460. ;; is used.
  461. (defun windows-pop ()
  462.   (construct-window-menu "Windows" '(pop-to-window)))
  463.  
  464.  
  465. ;;=============================================================================
  466. ;;
  467. ;;        Behaviors
  468. ;;
  469. ;;=============================================================================
  470.  
  471. ;;=============================================================================
  472. ;;        Root behavior
  473. ;;=============================================================================
  474.  
  475. ;; This one uses several of the menus defined above
  476. (setq root-behavior
  477.   (state-make
  478.     (on (buttonpress 1 alone) (vtwm-pop-menu login-pop))
  479.     (on (buttonpress 1 with-shift) (vtwm-pop-menu emacs-pop))
  480.     (on (buttonpress 2 alone) (vtwm-pop-menu start-pop))
  481.     (on (buttonpress 2 with-shift) (vtwm-pop-menu xload-pop))
  482.     (on (buttonpress 3 alone) (vtwm-pop-menu root-pop))
  483.     (on (buttonpress 3 with-shift) (vtwm-pop-menu (windows-pop)))
  484.     (on (keyrelease (key-make "Menu") any) 
  485.         (execute-string (+ "(? " cut-buffer ")")))
  486.    ))
  487.  
  488. ;;=============================================================================
  489. ;;        Common behavior for windows and icons
  490. ;;=============================================================================
  491.  
  492. (setq standard-behavior
  493.   (state-make
  494.     (on (buttonpress 1 alone) (raise-lower-move-window))
  495.     (on (buttonpress 1 with-alt) (raise-lower-move-window))
  496.     (on (buttonpress 2 alone) (move-window))
  497.     (on (buttonpress 2 with-alt) (move-window))
  498.     (on (buttonpress 3 alone) (vtwm-pop-menu window-pop))
  499.     (on (buttonpress 3 with-alt) (vtwm-pop-menu window-pop))
  500.     (on (keyrelease (key-make "Menu") any) 
  501.         (execute-string (+ "(? " cut-buffer ")")))
  502.    ))
  503.  
  504. ;;=============================================================================
  505. ;;        Window behavior
  506. ;;=============================================================================
  507.  
  508. (setq window-behavior
  509.   ())                   ; Nothing more than standard-behavior
  510.  
  511. ;;=============================================================================
  512. ;;        Window titlebar behavior (in addition to above)
  513. ;;=============================================================================
  514.  
  515. (setq standard-title-behavior
  516.   ())                   ; Nothing more than standard-behavior
  517.  
  518. ;;=============================================================================
  519. ;;        Icon behavior
  520. ;;=============================================================================
  521.  
  522. (setq icon-behavior
  523.   (state-make
  524.     (on (buttonpress 1 alone) (pop-to-window))
  525.    ))
  526.  
  527. ;;=============================================================================
  528. ;;        Icon Manager behavior
  529. ;;=============================================================================
  530.  
  531. (setq icon-mgr-behavior
  532.   (state-make
  533.     (on (buttonpress 1 any)
  534.         (icon-mgr-with-window
  535.           (pop-to-window)))
  536.     (on (buttonpress 2 any)
  537.         (icon-mgr-with-window
  538.           (toggle-iconify-window)))
  539.     (on (buttonpress 3 any)
  540.         (icon-mgr-with-window
  541.           (vtwm-pop-menu window-pop)))
  542.     ))
  543.  
  544. ;;=============================================================================
  545. ;;        Grabs (i.e. which events to steal from clients)
  546. ;;=============================================================================
  547.  
  548. (: vtwm-grabs (list
  549.                (button any with-alt)
  550.                (key "Menu" any)))
  551.  
  552.  
  553. ;;=============================================================================
  554. ;;
  555. ;;        Miscellaneous
  556. ;;
  557. ;;=============================================================================
  558.  
  559. ;; Where on the screen to put icons: down the right edge
  560. (set-icon-placement any rows.right-top.placement)
  561. (rows.limits rows.right-top 
  562.              'start 180
  563.              'offset 6
  564.              'separator 4)
  565.  
  566. ;; Place xclock, xbiff and all xloads in top of screen
  567. (set-placement XLoad rows.top-right.placement) 
  568. (set-placement XClock rows.top-right.placement)
  569. (set-placement XBiff rows.top-right.placement)
  570. (rows.limits rows.top-right 
  571.              'start 324 
  572.              'offset 4 
  573.              'separator 6
  574.              'sort (lambda (w1 w2) 
  575.                      (compare (or (member (with (wob w1) window-client-class)
  576.                                           '(XBiff XClock XLoad)) 3)
  577.                               (or (member (with (wob w2) window-client-class)
  578.                                           '(XBiff XClock XLoad)) 3))))
  579.  
  580. ;; Code to run when screen is ready. Put creation of initial doors, and
  581. ;; multiple icon managers here.
  582. (: to-be-done-after-setup '(progn
  583.                              (add-door "Home")
  584.                              (add-door "Free Area" 'free 'movable)
  585.                              ;; example on how to create multiple icon managers
  586.                              ; (make-icon-mgr "Xterm" -6 206 'XTerm)
  587.                              ; (make-icon-mgr "Emacs" -6 406 'Emacs)
  588.                              ))
  589.