Subject: Re: Fvwm and Scwm

From: Greg Badros <[email-masked]>
Date: 03 Sep 1998 14:08:29 -0700

Nadim Saeed <[email-masked]> writes:

>   + Could an SCWMer post an example of their .scwmrc file (for comparison) ?

Sorry for the long long long long delay in responding to this (maybe I
did already respond... I can't remember...)  In any case, here is a copy 
of gjb.scwmrc, the startup file I use when running scwm.  It has
virtually all the features of my TheNextLevel fvwm2 configuration that
was included with RedHat 4.x (and, as a consequence, also basically all
the features in their AnotherLevel extension of my m4 magic which is
included in RedHat 5.x).

Sorry in advance for the length of this mail.  I highly recommend
viewing it in scheme-mode or scwm-mode (M-x scheme-mode in (X)Emacs)
with font-lock-mode on so that the colorization can help you with the
syntax (especially useful if you've not read much scheme code before).

Greg

;; $Id: gjb.scwmrc,v 1.84 1998/09/02 18:37:44 gjb Exp $ -*- scwm -*-

;; Uncomment the below to send a single UDP packet to
;; the scwm usage counter machine at startup
;; The single packet just contains the hostname and version number
;; To disable, set environment variable SCWM_DO_NOT_LOG_USAGE
;;(define thank-scwm-authors-with-usage-note #t)

;;-------------------------------;;
;; import the scwm modules       ;;

(define xlock-query-program "xlock-stdout")

(define debug #t)

(define (debug-display arg)
  (if debug
      (display arg)
      ()))

(use-modules (app scwm base)
	     (app scwm winops)
	     (app scwm winlist)
	     (app scwm wininfo)
             (app scwm style)
	     (app scwm face)
	     (app scwm optargs)
	     (app scwm std-menus)
	     (app scwm prefs-menu)
	     (app scwm doc)
	     (app scwm flux)
	     (app scwm fvwm-module)
	     )

;;; print some information
(for-each (lambda (d) (debug-display d)) 
	 (list " *** Reading `scwmrc'...\nScwm v" (scwm-version) "\n"
	       "Display Size: " (display-size)
	       "\nDesk Size: " (desk-size) "\nViewport Position: "
	       (viewport-position) "\nCurrent Desk: " (current-desk) "\n"))

(define HOME (getenv "HOME"))
(define USER (getenv "USER"))

(set! doc-files '("/scratch/gjb/scwm/doc/scwm-procedures.txt"))
;;(define-public doc-files        ; '("/usr/src/scwm/doc/scwm-procedures.txt")
;;  (list (string-append (scwm-path-prefix) "/share/scwm/scwm-procedures.txt")
;;	(string-append (scwm-path-prefix) "/share/scwm/cassowary_scm-procedures.txt")))

;;;(documentation "make-menuitem")
;;;(apropos-internal "*")

(set! fvwm2-module-path (append fvwm2-module-path '("/uns/lib/fvwm2")))
(define want-fvwm2-pager-module #t)
(define want-fvwm2-winlist-module #t)

(set! opaque-move-percent 100)
;;(set! opaque-move-percent 20)
(set! opaque-resize-percent 100)
;;(set! opaque-resize-percent 20)

;; Disabled autoraise by default; 
;; would give an instant autoraise with no timeout, which 
;; is not all that useful
(define want-autoraise #f)
(define want-workman-menu #t)

(define xterm-user-shell-options "-e start-zsh")
(define xterm-program-name "color-xterm")

(define use-complete-host-menu #t)
(define xterm-other-host-use-local-xterm #t)

(define mail-spool-dir (string-append "/var/spool/mail/" USER))

;; Want a Win95-like "X" button at top right of window decoration
;; to immediately close the window?
;; (Generally, I find that that makes it too easy to accidentally
;;  destroy a window, so the basic setting is #f)
(define want-close-button #f)

(define user-image-load-list 
  (list (string-append HOME "/pixmaps")
	(string-append HOME "/bitmaps")))

;;-------------------------------;;
;; set some basic styles info    ;;

(define font12
  (make-font "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*"))
(define font14 
  (make-font "-adobe-helvetica-bold-r-*-*-14-*-*-*-*-*-*-*"))
(define window-font
  (make-font "*helvetica*bold-r*12*"))
(define menu-font
  (make-font "*helvetica*medium-r*12*"))
(define bold-menu-font
  (make-font "*helvetica*bold-r*9*"))
(define icon-font
  (make-font "fixed"))

(define (start-program-in-xterm binary title resources)
  (string-append binary " -T" title " -name " resources))

(define applications-available-program-information
  `(
    ("&Netscape" "nscape" "netscape_3d" "netscape")
    ("&Emacs" "edit" "emacs_3d" "xemacs")
    ("Email (&Gnus)" #f #f "emailuw")
;;    ("Calenda&r" "clock" "calendar.next" "PREFERRED_CALENDAR_BIN")
    ("&Ical" "clock" "calendar.next" "ical")
;;    ("&Plan" "clock" "calendar.next" "plan")
    ("WindowsN&T" #f #f "start_nt")
    ("&RedBaron" #f #f "redbaron")
    ("Grail" #f #f "grail")
    ("&Pine" "letter" "Mail" 
	     ,(start-program-in-xterm "pine" "Pine" "pinexterm"))
    ("Framema&ker" "book2" "book_3d" "framemkr")
    ("Acroread (PDF Viewer)" #f #f "acroread")
    ("&Answerbook" "book2" "book_3d" "answerbook")
    ("Ghost&view" "gv" "view_3d" "ghostview")
    ("X&Dvi" "doc" "xdvi.next" "xdvi")
    ("Xvie&w" "xv" "xv.color" "xv")
    ("Text&edit" "edit" "TextEditor" "textedit -geometry 630x490+95+5")
    ("Xedit" "edit" "document_3d" "xedit")
    ("GnuP&lot" "plot" "Chart" 
		,(start-program-in-xterm "gnuplot" "GnuPlot" "gnuplotxterm"))
    ("X&Fig" "pencil" "fig_3d" "xfig")
    ("&XPaint" "paint" "paint_3d" "xpaint")
    ("Mathematica" #f #f "frontend")
    ("De&bugger" "bug2" "debug_3d" "debugger")
    ("Xxgd&b" "bug2" "debug2_3d" "xxgdb")
    ("gdb" "bug2" "debug2_3d" 
	   ,(start-program-in-xterm "gdb" "GDB" "gdbxterm"))
    ("XWpe" #f #f "xwpe")
    ("Arena Browser" #f #f "arena")
    ("XLispstat" #f #f 
		 ,(start-program-in-xterm "xlispstat" "XLispStat" "xlispxterm"))
    ("Chipmunk Basic" #f #f
		      ,(start-program-in-xterm "basic" "Chipmunk Basic" "basicxterm"))
    ("&Irc" #f #f ,(start-program-in-xterm "irc" "IRC" "ircxterm"))
    ("&Minicom" #f #f ,(start-program-in-xterm "minicom -c on" "Minicom" "minicomxterm"))
;;    ("Tin" #f #f ,(start-program-in-xterm "tin -r" "News (tin)" "tinxterm"))
;;    ("T&rn" #f #f ,(start-program-in-xterm "trn" "News (trn)" "trnxterm"))
    ("Athena" #f #f "athena")
    ("XGopher" #f #f "xgopher")
    ("XPdf" #f #f "xpdf") ;; used to have a get-file option
    ("X&jed" #f #f "xjed")
    ("Xedit" #f #f "xedit")
    ))

(define utilities-available-program-information
  `(
    ("&Control Panel" #f #f "control-panel")
    ("&Glint" #f #f "glint")
    ("Color &XTerm" "sh1" "XTERM_ICON" "COLOR_XTERM -cr blue")
    ("&Manual pages" "book1" "manpage_3d" "xman")
    ("XCa&lc" "calc" "Calculator" "xcalc")
    ("Filemanager" "filemgr" "FileManager" "filemgr")
    ("X&fm" "filemgr" "FileManager" "xfm")
    ("XF&tp" "xftp" "ftp_3d" "xftp")
    ("X&Quote" #f #f "Xquote")
    ("Ma&gnifying glass" "zoom" "mag_glass_3d" "xmag")
    ("XLo&ad" "run" "xload.next" "xload")
    ("Xgrab" "camera" "camera_3d" "xgrab")
    ("X&colormap" "colors" "colormap_3d" "xcolormap")
    ("Font&sel" #f #f "xfontsel")
    ("&Editres" #f #f "editres")
    ("Clip&board" #f #f "xclipboard")
    ("X&Osview" #f #f "xosview")
    ("Cloc&k" #f "oclock_3d" "xclock")
    ("XBiff" #f #f "xbiff -bg MENUBACK_COLOR")
    ("Xev" #f #f "xev")
    ))

(define games-available-program-information
  `(
    ("X&Board" "slon" "chess_3d" "xboard -sze medium")
    ("&Spider" #f "cards_3d" "spider")
    ("X&Lander" #f #f "xlander")
    ("X&Mahjongg" #f #f "xmahjongg")
    ("X&Vier" #f #f "xvier")
    ("XPat&ience" #f #f "xpat2")
    ("XMo&rph" #f #f "xmorph")
    ("XE&vil" #f #f "xevil")
    ("&XBill" #f #f "xbill")
    ("XBlock&out" #f #f "xbl")
    ("XSnow" #f #f "xsnow")
    ("X&Gammon" #f #f "xgammon")
    ))

(define multimedia-available-program-information
  `(
    ("XM&ix" "audiovol" "Multimedia" "xmix")
    ("XMi&xer" "audiovol" "Multimedia" "xmixer")
    ("&WorkMan" "cdlabel" "cdrom2_3d" "workman")
    ("XPlay&Cd" "cdlabel" "cdrom2_3d" "xplaycd")
;;    ("&Tracker" #f #f "tracker \\$(xgetfile -title 'Select a MOD file for Tracker' -path $MOD_SOUND_PATH -pattern '*.mod')" #f)
;;    ("Play&midi" #f #f "xplaymidi \\$(xgetfile -title 'Select a MIDI file for PlayMidi' -path $MIDI_SOUND_PATH -pattern '*.mid')" #f)
    ("Xm&play" #f #f "xmplay")
    ))

;;; These can change dynamically and the menus which 
;;; used 'menu-bg-color [which is used by default]
;;; will be drawn in the new color the next time they pop up
(set! menu-bg-color (make-color "gray80"))
(set! menu-text-color (make-color "black"))

;; (color-properties (make-color "#cc88ff"))

(menu-style #:fg "black" #:bg "gray80" #:stipple "grey35" 
	    #:font menu-font #:mwm #f)

(set-message-window-attributes! (make-font "*helvetica*medium-r*18*")
				"black" "gray80")

;; (select-window-interactively "Pick window #1")

;;(set-click-delay! 150)
;;(set-color-map-focus! 'follows-mouse)
;;(set-desktop-size! 3 3)

(set-edge-scroll-delay! 500)
(set-edge-move-threshold! 10)

(set-edge-scroll! (%x 100) (%y 100))

(title-style #:font font12 #:justify 'left #:relief 'raised)

(set-icon-font! font12)
(set-rubber-band-mask! 255)  

(define (popup-small-ops)
  (popup-menu (make-small-window-ops-menu (get-window))))

(define (popup-sysutils)
  ())

(define (popup-util)
  (popup-menu 'menu-util))

(define (popup-applications)
  (popup-menu 'menu-applications))

(define (popup-root-start)
  (popup-menu 'menu-root-start))

(define (show-icon-list-menu)
  (show-window-list-menu #:only iconified? #:warp-to-first #t))

(define (show-xterm-window-list-menu)
  (show-window-list-menu #:only (lambda (w) (string=? (window-class w) "XTerm")) 
			 #:warp-to-first #t))

;;(select-window-from-window-list)
;;(select-window-interactively)
;;(restack-windows (select-multiple-windows-interactively))

(debug-display "Before setting image-load-path\n")

;;; set path to use for image searches
(set! image-load-path (cons "/usr/X11/lib/X11/mini-icons" image-load-path))
(set! image-load-path (cons "/usr/X11/include/X11/pixmaps" image-load-path))
(set! image-load-path (cons "/usr/lib/icons" image-load-path))
(set! image-load-path (cons "/usr/local/X11/include/X11/pixmaps" image-load-path))
(set! image-load-path (cons "/usr/local/lib/icons" image-load-path))
(set! image-load-path (cons "/usr/local/icons" image-load-path))
(set! image-load-path (cons "/uns/share/include/X11/pixmaps" image-load-path))
(set! image-load-path (cons "/uns/share/include/X11/bitmaps" image-load-path))
(set! image-load-path (cons "/usr/lib/TheNextLevel/pixmaps" image-load-path))
(set! image-load-path (append user-image-load-list image-load-path))
;;(set! image-load-path '())

(define (suggest-image-path-for name)
  (let ((found-if-0 (system (string-append "locate " name))))
    (if (= 0 found-if-0)
	(display (string-append "Perhaps try adding above path to image-load-path\n")))))

(define (image-not-found-hook name) 
  (display (string-append "Could not find image: " name "\n"))
  (suggest-image-path-for name))

(define pic-system-button
  (make-image "mini-sys3d-full.xpm"))

(define pic-xterm-mini
  (make-image "mini-term.xpm"))

(define pic-unknown
  (make-image "unknown1.xpm"))
;; (reset-scwm-exec-protocol)

;;-------------------------------;;
;; set some window styles        ;;

;;; MSFIX: I don't like the ordering dependence on the
;;; window-style... I think that will go away when using
;;; the XClass and/or Instance name tests, which I'd prefer
;;; anyway...
(window-style "*" 
	      #:fg "black" #:bg "grey76" 
	      #:icon #f ;; this turns off icons, but leaves icon titles
	      #:show-icon #f ;; this turns off both icon titles and icons
	      #:icon-box (list (x- 70) 1 69 (y- 141))
	      #:border-width 4
	      #:focus 'mouse
;	      #:plain-border #t
	      #:sticky-icon #t
	      #:random-placement #t #:smart-placement #t
	      #:mwm-func-hint #t #:mwm-decor-hint #t
	      #:mwm-border #t
	      #:int-override #t #:decorate-transient #f
	      #:PPosition-hint #f
	      #:mini-icon pic-xterm-mini)

(window-style "*" 
	      #:icon-box (list 0 1 69 (y- 141)))

;; (window-style "*" #:show-icon #t)
;; (window-style "*" #:sticky-icon #f)
;; (window-style "*" #:sticky-icon #t)
;; (window-style "*" #:random-placement #f #:smart-placement #f)

;;(window-style "*" #:border-width 5 #:mwm-border #t)

(window-style "xlogo" #:no-titlebar #t #:normal-border #t)
;;(window-style "*" #:border-width 6)
;;(resize-to 200 200)

;;(window-style "*" #:squashed-titlebar #t)
;;(window-style "*" #:bg "purple")
;; (border-style #:hidden-handles #f #:no-inset #f)

;; (raise-window)
;; (set-object-property! (select-window-interactively) 'squashed-titlebar #t)
;; (set-object-property! (select-window-interactively) 'no-side-decorations #t)
;; (set-object-property! (select-window-interactively) 'no-side-decorations #f)
;; (define w (select-window-interactively))

;; This gets my netscape bookmarks windows to do the right thing
;; and stay on screen (instead of being half off screen when mapped)
(set-smart-placement-is-really-smart! #t)

;; (normal-border (current-window-with-pointer))

(define (place-near-pointer w)
  (let* ((posn (pointer-position))
	 (x (car posn))
	 (y (cadr posn)))
    (set! x (- x 60))
    (set! y (- y 45))
;;    (display "x = ") (display x)
;;    (display ", y = ") (display y) (newline)
    (move-to x y w)))

(define (place-interactively win)
  (let* ((posn (pointer-position))
	 (size (window-size win))
	 (w (car size))
	 (h (cadr size))
	 (x (- (car posn) (/ w 2)))
	 (y (- (cadr posn) (/ h 2))))
    (move-to x y win)
    ;; don't use an opaque move, since window is
    ;; not mapped before the placement-proc gets called
    (interactive-move win #f)))

(define (netscape-win)
  (car 
   (list-windows #:only 
		 (lambda (w) 
		   (and (string=? (window-class w) "Netscape")
			(string=? (window-resource w) "Navigator"))))))

;;(define ns-win (select-window-interactively))
;;(define (netscape-win) ns-win)

(define (move-next-to-netscape-win w)
  (let* ((ns-pos (window-position (netscape-win)))
	 (x (+ (car ns-pos) 300))
	 (y (- (cadr ns-pos) 30)))
    (move-to x y w #f #f)
    (move-pointer-to (+ x 30) (+ y 55))
    (write-all #t "moving next to netscape window " x y "\n")))

;;(window-title (select-window-interactively))
;;(move-next-to-netscape-win (select-window-interactively))

;; FIXGJB: this is a bit unintuitive-- must use transient-placement-proc
;; instead of just placement-proc, even though I've explicitly
;; named the window
(window-style "Netscape: Find" #:transient-placement-proc (thunk move-next-to-netscape-win))

;;(window-style "Netscape: Find" #:no-titlebar #t) ;; not needed -- it's a transient
;;(window-style "findDialog_popup" #:placement-proc (thunk move-next-to-netscape-win))
;; (move-next-to-netscape-win (select-window-interactively))

;; FIXGJB: make-face's style of argument passing
;; is different from the window-style method; I imagine
;; MS has a wrapper planned for this (MSFIX)
(border-style #:hidden-handles #t #:no-inset #t)

;; Some wrappers for button functions
(define (vertical-toggle-maximize)
  (toggle-maximize 0 (%y 100)))

(define (horizontal-toggle-maximize)
  (toggle-maximize (%x 100) 0))

(define (both-toggle-maximize)
  (toggle-maximize (%x 100) (%y 100)))

(define (vertical-toggle-maximize-partial)
  (toggle-maximize 0 (%y 95)))

;;; I'm not changing these for now to use the new style
;;; because of the way add-left-button and add-right-button work and
;;; such; I think in general, though, setting the button appearance
;;; should be more separated from setting its function. Will look
;;; over this more. --MS
;;; MSFIX: I think actions and conceptual appearance should go together
;;; but that conceptual appearance and actual appearance should be separated.
;;; Now that pixmaps are real objects, I get this by making, e.g.,
;;; `sticky-button-face' and `(add-left-button sticky-button-face toggle-stick)'
;;; I never want to say, `the third button from the right should do this action'.
;;; Ideally, buttons should have some identifier which can be tested by the
;;; event handling code for the callbacks

(define mini-icon-button-face 
  (make-face '((relief flat))
	     '((pixmap mini-program-icon))))

;; Can use strings as arg to pixmap
(define sticky-button-face
  (make-face '((relief flat))
	     '((pixmap "mini-hbars-full.xpm")))
;;  (make-face '((relief raised))
;; ;;; 4 Horizontal bars (sticky)
;;	     '((relief-pattern
;;		((10 23 #f) (90 23 #f) (90 28 #f) (10 28 #t) (10 47 #t) 
;;			    (90 47 #f) (90 52 #f) (10 52 #t) (10 70 2) 
;;			    (90 70 #f) (90 76 #f) (10 76 #t)))))
)

;; For testing
;;(set-button-face! 3 sticky-button-face)

;; But can also use a (make-image  "file.xpm")
(define sysutils-button-face
  (make-face '((relief flat))
	     '((pixmap "mini-lightbolt-full.xpm")))
;;  (make-face '((relief raised))
;; ;;; Big Lighting Bolt (Fat at top, comes to a point)
;;	     '((relief-pattern
;;		((35 15 #t) (20 50 #t) (40 50 #f) (30 80 #t) (75 40 #f) 
;;			    (50 40 #t) (75 15 #f) (35 15 #t)))))
)

(define close-button-face
  (make-face '((relief flat))
	     '((pixmap  "mini-stylized-x-full.xpm")))
;;  (make-face '((relief raised))
;; ;;; Stylized X
;;	     '((relief-pattern
;;		((20 20 #t) (30 20 #t) (50 40 #t) (70 20 #t) (80 20 #t) 
;;			    (80 30 #f) (60 50 #f) (80 80 #f) (70 80 #f) 
;;			    (50 60 #f) (30 80 #f) (20 80 #f) (20 70 #f) 
;;			    (40 50 #t) (20 30 #f) (20 20 #t)))))
)

(define tall-maximize-button-face 
  (make-face '((relief flat))
	     '((pixmap "mini-exp-windows-full.xpm")))
;;  (make-face '((relief raised))
;; ;;; tall box
;;	     '((relief-pattern 
;;		((40 25 #t) (60 25 #t) (60 75 #f) (40 75 #f) (40 25 #t)))))
)

(define iconify-button-face 
  (make-face '((relief flat))
	     '((pixmap "mini-shrink-windows-full.xpm")))
;;  (make-face '((relief raised))
;; ;;; 3 stacked square panels like stills of a window being minimized
;;	     '((relief-pattern
;;		((80 20 #f) (80 60 #f) (60 60 #f) (60 40 #f) (60 70 #f) 
;;			    (40 70 #f) (40 60 #f) (40 85 #f) (15 85 #f) 
;;			    (15 60 #t) (40 60 #t) (30 60 #t) (30 40 #t) 
;;			    (60 40 #t) (45 40 #t) (45 20 #t) (80 20 #t)))))
)

(define left-button-number 1)
(define right-button-number 2)

;;(set-button-face! 1 mini-icon-button-face)

(define (add-left-button button-face hook)
  (set-button-face! left-button-number button-face)
  (bind-mouse (string->symbol 
	       (string-append "button-" 
			      (number->string left-button-number)))
	      1 hook)
  (set! left-button-number (+ 2 left-button-number)))

(define (add-right-button button-face hook)
  (set-button-face! right-button-number button-face)
  (bind-mouse (string->symbol 
	       (string-append "button-" 
			      (number->string right-button-number)))
	      1 hook)
  (set! right-button-number (+ 2 right-button-number)))

;;; window buttons
;(bind-mouse 'button-1 1 popup-small-ops)
;(bind-mouse 'button-2 1 vertical-toggle-maximize)
;(bind-mouse 'button-4 1 iconify)

;;(set-button-face! 1 mini-icon-button-face)
;;(set-button-face! 1 tall-maximize-button-face)

;;;(add-left-button system-button-face (lambda () (popup-small-ops)))
(define (popup-small-ops-or-close)
  (case (mouse-event-type)
    ((double-click) (close-window))
    (else (let ((w (get-window)))
	    (popup-menu-from-decoration 
	     (make-small-window-ops-menu w) w 1)))))
;; the "1" at the end of the prior line is the button number from which 
;; this is popped. FIXGJB return lambda

(add-left-button mini-icon-button-face popup-small-ops-or-close)
;;(show-titlebar (select-window-interactively))
;;(bind-mouse 'button-1 1 popup-small-ops-or-close)

;; MS: I presume this is the desired efffect.
;; random thought: A nice extension would be buttons that change
;; appearance with given window properties. This would be an extension of
;; the fvwm2 "MWMButton" concept whereby a button reverses its vector 
;; pattern when the window is maximized. It should be much more general, 
;; of course.
(add-left-button sticky-button-face toggle-stick)

(add-left-button sysutils-button-face popup-sysutils)

(if want-close-button
    (add-right-button close-button-face close-window))

(add-right-button tall-maximize-button-face vertical-toggle-maximize)
(add-right-button iconify-button-face iconify)

;; (plain-border (get-window)) fixes the display problem for the selected window
;; something must not be initialized correctly

(set-hilight-foreground! "white")
(set-hilight-background! "navyblue")

(define desk-widget
  (make-style #:plain-border #t #:sticky #t #:winlist-skip #t
	      #:border-width 3 #:circulate-skip #t #:focus 'none))

;; Inherit above style options and specialize
(define desk-widget-on-top
  (make-style #:use-style desk-widget #:kept-on-top #t))

(define desk-widget-on-top-no-titlebar
  (make-style #:use-style desk-widget-on-top #:no-titlebar #t))

;; NOTE: you can use a string or a (make-image "filename.xpm")
;; after #:icon and #:mini-icon
;; MSFIX: important! window-style's argument 
(window-style "FvwmPager" #:use-style desk-widget-on-top-no-titlebar)
(window-style "zwgc" #:use-style desk-widget-on-top)
(window-style "*lock" #:use-style desk-widget)
(window-style "xclock*" #:use-style desk-widget-on-top-no-titlebar)
(window-style "xload" #:no-title #t #:use-style desk-widget-on-top-no-titlebar)
(window-style "xscreensaver" #:no-title #t #:use-style desk-widget)
(window-style "xbiff" #:no-title #t #:use-style desk-widget-on-top
	      #:mini-icon "mini-xbiff.xpm")
(window-style "xcalc" #:icon "xcalc.xpm"
	              #:mini-icon "mini-calc.xpm")
(window-style "xman" #:icon "xman.xpm")
(window-style "xmag" #:icon "mag_glass.xpm")
(window-style "XTerm" #:mini-icon pic-xterm-mini
	              #:icon "xterm.xpm")
(window-style "Emacs" #:mini-icon "mini-edit.xpm"
	              #:icon "TextEditor.xpm")

(debug-display "Before menu-window-ops\n")

;;; define some useful menus
(define menu-window-ops
  (menu
   (list
    (menuitem "Window Ops" #f) menu-title
    (menuitem "&Move" #:image-left "mini-move.xpm" 
	       #:action interactive-move-maybe-opaque)
    (menuitem "&Resize" #:image-left "mini-resize.xpm" 
	       #:action interactive-resize-maybe-opaque)
    (menuitem "R&aise" #:image-left "mini-raise.xpm" 
	       #:action (thunk raise-window))
    (menuitem "&Lower" #:image-left "mini-lower.xpm" 
	       #:action (thunk lower-window))
    (menuitem "&Iconify/Restore" #:image-left "mini-iconify.xpm" 
	       #:action (thunk toggle-iconify))
    (menuitem "&Stick/Unstick" #:image-left "mini-stick.xpm" 
	       #:action (thunk toggle-stick))
    (menuitem "Ma&ximize/Reset" #:action (thunk both-toggle-maximize))
    (menuitem "Ma&ximize &Tall/Reset" #:image-left "mini-maxtall.xpm" 
	       #:action (thunk vertical-toggle-maximize))
    (menuitem "Maximize &Wide/Reset" #:image-left "mini-maxwide.xpm"
	       #:action (thunk horizontal-toggle-maximize))
    (menuitem "Animated S&hade/Reset" 
	       #:action (thunk toggle-window-shade-animated))
    (menuitem "Shade/Reset" 
	       #:action (thunk toggle-window-shade))
    menu-separator
    (menuitem "Keep-&on-top/Reset" #:action (thunk toggle-on-top))
    (menuitem "&Print" #:action (thunk print-window))
    menu-separator
    (menuitem "&Delete" #:action (thunk delete-window))
    (menuitem "&Close" #:image-left "mini-cross.xpm" 
	       #:action (lambda () (close-window (get-window))))
    (menuitem "&Kill" #:image-left "mini-bomb.xpm" 
	       #:action (thunk destroy-window))
    menu-separator
    (menuitem "Switch to..." #:action
	       (lambda () 
		 (show-window-list-menu #:show-geometry #t)))
    (menuitem "Re&fresh Screen" #:image-left "mini-ray.xpm" 
	       #:action (thunk refresh)))))

;;(popup-menu (thunk menu-window-ops))
;;(menu-properties menu-window-ops)

(defmacro menuitem-for-exec (name pixmap . body)
  (if (program-exists? name)
      `(list ,name #:action (lambda () (execute ,name) ,@body)
	     #:left-pixmap ,pixmap)))

;;(window-shade (get-window) #t)
;;(un-window-shade (get-window) #t)

;; wiggle-window just demonstrates 
(define (wiggle-window)
  (let ((w (get-window)))
    (window-shade w #t)
    (un-window-shade w #t)))

;;FIXGJB:
(define (scwm-help)
  (display "Need to write scwm-help\n"))

;;FIXGJB:
(define (scwm-about-message)
  (display "Need to write scwm-about-message\n"))

(define (start-xterm)
  (execute (string-append xterm-program-name " " xterm-user-shell-options)))

(define (start-xlogo)
  (execute "xlogo"))

(define (exec-xlock)
  (execute "xlock -nice -19 -mode blank"))

(define menu-quit-verify
  (menu 
   (list
    (menuitem "Really quit Scwm?" #f)
    menu-title
    (menuitem "Restart scwm" #:image-left "mini-turn.xpm" 
	       #:action (lambda () (restart "scwm")))
    menu-separator
    (menuitem "Yes" #:image-left "mini-exclam.xpm" #:action quit)
    (menuitem "No"  #:image-left "mini-cross.xpm" #:action noop))))

(define (quit-verify)
  (popup-menu menu-quit-verify #t))

;;;(map (lambda (elem)
;;;       (let ((menu-id (car elem))
;;;	     (menu-title (cadr elem))
;;;	     (menu-list (caddr elem)))
;;;	 (define menu-id
;;;	   (menu (cons menuitem menu-title)
;;;		 (make-menuitems-from-menu-information-list menu-list)))))
;;;     '(('menu-applications "Applications" applications-available-menu-information)
;;;       ('menu-utilities "Utilities" utilities-available-menu-information)))

;;;(defmacro (program-menu-maker str)
;;;  `(define ,(intern-symbol (string-append "menu" str))
;;;     (menu
;;;      (cons
;;;       (menuitem ,str)
;;;       (make-menuitems-from-menu-information-list
;;;	,(intern-symbol (string-append str "-available-menu-information")))))))
     
;;;(program-menu-maker "applications")

(define menu-applications
  (menu (cons
	 (menuitem "Applications")
	 (make-menuitems-from-menu-information-list
	  applications-available-program-information)
	 )))

(define menu-utilities
  (menu (cons
	 (menuitem "Utilities")
	 (make-menuitems-from-menu-information-list
	  utilities-available-program-information)
	 )))

(define menu-multimedia
  (menu (cons
	 (menuitem "Multimedia")
	 (make-menuitems-from-menu-information-list
	  multimedia-available-program-information)
	 )))

(define menu-games
  (menu (cons
	 (menuitem "Games")
	 (make-menuitems-from-menu-information-list
	  games-available-program-information)
	 )))

(define (xterm-other-host hostname)
  (exe (string-append xterm-program-name " -name remotexterm -T " hostname " -n " hostname 
		      " -e sh -c 'ssh " hostname "'")))

(define server-hosts 
  '(pahtoo glacier june amaebi bauhaus)
  )

(define other-hosts 
  '( sturgeon thresher coho ;; Ultrix
	      forbidden pinnacle copper ;; AIX
	      pintail edgar bugs-bunny ;; DEC OSF
	      fireweed anemone bugbane buttercup ;; IRIX
	      ))

(define linux-hosts
  '( uni oz saba awabi hirmae nishin sake pugsly squiggy kani))

(define solaris-hosts
  '( tolt elwha chiwawa demille fielder froggie hammahamma hoobes hoh rhodes twain))

;; (popup-menu menu-hosts #t)
(define (make-hosts-menu-gjb hosts)
  (cons menu-title
	(fold-menu-list
	 (map
	  (lambda (elem)
	    (menuitem elem #:image-left "mini-display.xpm" #:action (xterm-other-host elem)))
	  hosts))))

(define menu-hosts-servers
  (menu (cons
	 (menuitem "Hosts (Servers)") 
	 (make-hosts-menu-gjb server-hosts))))

(define menu-hosts-linux
  (menu (cons
	 (menuitem "Hosts (Linux)") 
	 (make-hosts-menu-gjb linux-hosts))))

(define menu-hosts-solaris
  (menu (cons
	 (menuitem "Hosts (Solaris)") 
	 (make-hosts-menu-gjb solaris-hosts))))

(define menu-hosts-other
  (menu (cons
	 (menuitem "Hosts (Other)") 
	 (make-hosts-menu-gjb solaris-hosts))))

(define menu-preferences-scroll
  (menu (list
	 (menuitem "Change Scroll Behavior")
	 menu-title
	 (menuitem "&On" #:action (lambda () (set-edge-scroll 100 100)))
	 (menuitem "O&ff" #:action (lambda () (set-edge-scroll 0 0)))
	 (menuitem "&Horizontal Only" #:action (lambda () (set-edge-scroll 100 0)))
	 (menuitem "&Vertical Only" #:action (lambda () (set-edge-scroll 0 100)))
	 (menuitem "&Partial 1/2" #:action (lambda () (set-edge-scroll 50 50)))
	 (menuitem "Partial 1/&4" #:action (lambda () (set-edge-scroll 25 25))))))

;; (popup-menu (menu-prefs) #t)

(define menu-prefs-gjb
  (menu (list (menuitem "Preferences" #f) menu-title menu-separator
	      (menuitem "Reload X resources" #:action
			(exe "xrdb -merge ${HOME}/.Xresources"))
	      (menuitem "View all icons" #:action
			(exe (apply string-append "xv "
				    (map (lambda (st) (string-append st "/* "))
					 image-load-path))))
	      (menuitem "SCWM interaction" #:action
			(run-in-xterm "/usr/local/bin/scwmrepl"))
	      (menuitem "Info on a window" #:action window-info)
;	      menu-separator
;	      (menuitem "Opaque Move" #:action opaque-move-menu)
;	      (menuitem "Desk Size" #:action desk-size-menu)
;	      (menuitem "Scrolling" #:action scroll-menu)
;	      menu-separator
;	      (menuitem
;	       "User Init File" #:action
;	       (menu (list
;		      (menuitem "Reload" #:action
;				(lambda () (load user-init-file)))
;		      (menuitem "View" #:action (show-file user-init-file))
;		      (menuitem "Edit" #:action
;				(exe (string-append
;				      (or (getenv "EDITOR") "gvim")
;				      " " user-init-file))))))
;	      (menuitem "Save settings" #:action save-settings))))
	      )))

(define menu-preferences menu-prefs-gjb)

(define menu-system-utilities
  (menu
   (list
    (menuitem "Preferences"))))

(define menu-screensaver
  (make-xlock-menu #f))

(if want-workman-menu
    (define (tell-workman command)
      (execute (string-append "workman -s " command)))
    (define menu-workman
      (menu (list
	     (menuitem "&Pause" #:image-left "mini-wm-pause.xpm"
		       #:action (lambda () (tell-workman "pause")))
	     (menuitem "P&lay" #:image-left "mini-wm-play.xpm"
		       #:action (lambda () (tell-workman "play")))
	     (menuitem "&Next" #:image-left "mini-wm-next.xpm"
		       #:action (lambda () (tell-workman "fwd")))
	     (menuitem "P&rev" #:image-left "mini-wm-prev.xpm"
		       #:action (lambda () (tell-workman "back")))
	     (menuitem "&Stop" #:image-left "mini-wm-stop.xpm"
		       #:action (lambda () (tell-workman "stop")))
	     (menuitem "&Eject" #:image-left "mini-wm-eject.xpm"
		       #:action (lambda () (tell-workman "eject")))))))

;;; FIXGJB introduce syntax which gives the popup-menu-root-start closure after
;;; defining a menu
(define menu-root-start
  ;;  (menu "RootStart" "Start %mini-exp.xpm%"
  (menu
   (list 
    (menuitem "Start" #:image-left "mini-exp.xpm")
    menu-title
    (menuitem "&New shell" #:image-left "mini-sh1.xpm" 
	      #:action 'start-xterm)
    (menuitem "&Applications" #:image-left "mini-x2.xpm" 
	      #:action 'menu-applications)
    (menuitem "&Utilities" #:image-left "mini-hammer.xpm" 
	      #:action 'menu-utilities)
    (menuitem "&Multimedia" #:image-left "mini-audiovol.xpm" 
	      #:action 'menu-multimedia)
    (menuitem "&Games" #:image-left "mini-happy.xpm" 
	      #:action 'menu-games)
    menu-separator
    (menuitem "H&osts - Servers" #:image-left "mini-windows.xpm" 
	      #:action 'menu-hosts-servers)
    (menuitem "Hosts - Linux" #:image-left "mini-windows.xpm" 
	      #:action 'menu-hosts-linux)
    (menuitem "Hosts - Solaris" #:image-left "mini-windows.xpm" 
	      #:action 'menu-hosts-solaris)
    (menuitem "Hosts - Other" #:image-left "mini-windows.xpm" 
	      #:action 'menu-hosts-other)
    (menuitem "&System Utilities" #:image-left "mini-connect.xpm" 
	      #:action 'menu-system-utilities)
    (menuitem "&Window Operations" #:image-left "mini-windows.xpm" 
	      #:action 'menu-window-ops)
    (menuitem "&Preferences" #:image-left "mini-prefs.xpm" 
	      #:action 'menu-prefs)
;;	      #:action menu-prefs-gjb)
    menu-separator
    (menuitem "S&creensaver" #:image-left "mini-display.xpm" 
	      #:action 'menu-screensaver)
    (menuitem "&Lock Screen" #:image-left "mini-lock.xpm" 
	      #:action (thunk exec-xlock))
    menu-separator
    (menuitem "A&bout ScwmTNL" #:image-left "mini-exclam.xpm" 
	      #:action (thunk scwm-about-message))
    (menuitem "&Help ScwmTNL" #:image-left "mini-question.xpm" 
	      #:action (thunk scwm-help))
    (menuitem "E&xit Scwm" #:image-left "mini-stop.xpm" 
	      #:action 'menu-quit-verify))
   #:image-side "linux-menu.xpm"
   #:color-bg-image-side "blue"))

(debug-display "before-popup-menu-root-start\n")

(define (popup-menu-root-start)
  (popup-menu 'menu-root-start))

(define (popup-window-ops)
  (popup-menu 'menu-window-ops))

(define menu-desk 
  (menu 
   (list (menuitem "Desks" #f)
	 menu-title
	 (menuitem "Desk 1" #:action (lambda () (set-current-desk! 0)))
	 (menuitem "Desk 2" #:action (lambda () (set-current-desk! 1)))
	 (menuitem "Desk 3" #:action (lambda () (set-current-desk! 2)))
	 (menuitem "Desk 4" #:action (lambda () (set-current-desk! 3))))))

(define menu-util 
  (menu 
   (list
    (menuitem "Utilities" #f)
    menu-title
    (menuitem "xterm" #:image-left "mini-term.xpm" 
	       #:action "color_xterm")
    (menuitem "rxvt"
	       #:action (lambda () (execute "rxvt")))
    (menuitem "emacs" #:image-left "mini-edit.xpm" 
	       #:action (lambda () (execute "emacs")))
    (menuitem "top" #:action (lambda () (execute "rxvt -T Top -n Top -e top")))
    (menuitem "xcalc" #:action (lambda () (execute "xcalc")))
    (menuitem "xmag" #:action (lambda () (execute "xmag")))
    menu-separator
    (menuitem "Desks" #:action menu-desk)
    menu-separator
    (menuitem "Exit scwm" menu-quit-verify))
   #:font bold-menu-font))

(define (make-small-window-ops-menu w)
  (menu
   (list
    (menuitem "Window Ops Small" #f) menu-title
    (menuitem "&Move" #:image-left "mini-move.xpm" 
	       #:action interactive-move-maybe-opaque)
    (menuitem "Re&size" #:image-left "mini-resize.xpm" 
	       #:action interactive-resize-maybe-opaque)
    (menuitem (if (iconified? w)
		   "Unmi&nimize"
		   "Mi&nimize") #:image-left "mini-iconify.xpm" 
		   #:action iconify)
    (menuitem (if (maximized? w) 
			    "Unma&ximize" 
			    "Ma&ximize") #:action both-toggle-maximize)
    menu-separator
    (menuitem "More" 
	       #:action 
	       (menu 
		(list
		 (menuitem "&Raise" #:action raise-window)
		 (menuitem "&Lower" #:action lower-window)
		 (menuitem (if (sticky? w)
			       "Un&stick"
			       "&Stick") 
			   #:action toggle-stick)
		 (menuitem (if (window-shaded? w)
			       "Unwindow-S&hade"
			       "Window-S&hade")
			   #:action toggle-window-shade-animated)
		 (menuitem (if (kept-on-top? w)
			       "UnKeep On Top"
				   "Keep On Top") 
			   #:action toggle-on-top))))
    menu-separator
    (menuitem "Close" #:image-left "mini-cross.xpm" 
	      #:action close-window)
    (menuitem "Destroy" #:image-left "mini-bomb.xpm" 
	      #:action destroy-window))))

;;; now set some mouse and key bindings ;;

;;; first our root menus
(bind-mouse 'root 1 popup-root-start)
(bind-mouse 'root 2 (lambda () 
		      (show-window-list-menu #:show-geometry #t)))
(bind-mouse 'root "M-3" (lambda () (popup-menu 'menu-desk)))
(bind-mouse 'root 3 popup-applications)

;;; operations on parts of the window
(bind-mouse '(frame sidebar) 2 popup-small-ops)
(bind-mouse 'frame 1 resize-or-raise-maybe-opaque)
(bind-mouse 'sidebar 1 move-or-raise-maybe-opaque)

(define (move-or-shade)
  (case (mouse-event-type)
    ((double-click) (toggle-window-shade-animated))
    (else (move-or-raise-maybe-opaque))))
(bind-mouse 'title 1 move-or-shade)
(bind-mouse 'title 2 lower-window)
(bind-mouse 'title 3 popup-window-ops)

;; key bindings for the menus
(bind-key 'all "M-S-F1" popup-util)
(bind-key 'all "M-S-F2" popup-window-ops)

;; in case of emergency, hit Control-Meta-Q
(bind-key 'all "C-M-S-q" quit-verify)

;; some stuff for icons
(define (move-or-deiconify)
  (case (mouse-event-type)
    ((motion) (interactive-move-maybe-opaque))
    ((double-click) (deiconify))))

(bind-mouse 'icon 1 move-or-deiconify)
(bind-mouse 'icon 2 deiconify)

(bind-mouse 'all "C-S-M-1" toggle-raise)

;; These always do opaque moves
(bind-mouse 'all "C-S-M-2" opaque-interactive-move)
(bind-mouse 'all "C-S-M-3" opaque-interactive-resize)
;; These always do rubberband moves
(bind-mouse 'all "H-2" interactive-move)
(bind-mouse 'all "H-3" interactive-resize)

(define (resize-halfscreen)
  (let ((w (current-window-with-pointer)))
    (resize-to (%x 49) (%y 90))))

(define (resize-fullscreen)
  (let ((w (current-window-with-pointer)))
    (resize-to (%x 90) (%y 90))))

(bind-key 'all "C-S-F7" interactive-move-window-with-pointer)
(bind-key 'all "C-S-F8" interactive-resize-window-with-pointer)
(bind-key 'all "C-S-F9" window-info)
(bind-key 'all "C-M-S-e" resize-halfscreen)
(bind-key 'all "C-M-S-f" resize-fullscreen)

;; rotate the current window with the keyboard
(bind-key 'all "M-S-Tab" 
	  (lambda ()
	    (next-window #:only visible? #:except iconified?)))

(key-mouse-moves "C-M-S" 5 "h" "j" "k" "l")
;; XInside's old X server steal C-M-h for prev virtual console, so use m too
(key-mouse-moves "C-M-S" 5 "m" "j" "k" "l")

(key-mouse-moves "C-M-S" 1 "y" "u" "i" "o")

(key-viewport-moves "C-M-S" 100 "Left" "Down" "Up" "Right")
(key-viewport-moves "C-M-S" 10 "KP_4" "KP_2" "KP_8" "KP_6")

(bind-key 'all "C-M-S-Home" (lambda () (set-current-desk! 0)))
(bind-key 'all "C-M-S-End" (lambda () (set-current-desk! 1)))

(bind-key 'all "C-M-S-a" popup-applications)
;;(bind-key 'all "C-M-S-u" popup-util)  ;;; do not use this, since the key is bound to a mouse movement

(bind-key 'all "C-M-S-r" refresh)
(bind-key 'all "C-M-S-5" recapture)
(bind-key 'all "C-M-S-x" start-xterm)
(bind-key 'all "C-M-S-p" start-xlogo)

(bind-key 'all "C-S-F1" popup-small-ops)
(bind-key 'all "C-S-F2" show-window-list-menu)
(bind-key 'all "C-S-F3" (lambda () (popup-menu 'menu-hosts #t)))
(bind-key 'all "C-S-F4" (lambda () (popup-menu 'menu-applications #t)))
(bind-key 'all "C-S-F5" (lambda () (popup-menu 'menu-utilities #t)))
(bind-key 'all "C-S-F6" (lambda () (popup-menu 'menu-multimedia #t)))

(define (float->integer x)
	 (inexact->exact x))

;; These are useful!
(define root-size-x (car (display-size)))
(define root-size-y (cadr (display-size)))

;; FIXGJB: where is setenv?
;;(setenv "height" (number->string root-size-x))
(putenv (string-append "height=" (number->string root-size-y)))
(putenv (string-append "width=" (number->string root-size-x)))
;; FIXGJB: PLANES? SCWM_DIR? SCWM_VERSION?  want these exported too

(define (percent-display x y)
  (list (%x x) (%y y)))

(bind-key 'all "C-S-Down" iconify)
(bind-key 'all "C-M-Return" toggle-raise)
(bind-key 'all "M-F1" toggle-raise)   ;; like SGI's 4dwm

(bind-key 'all "C-S-Up" vertical-toggle-maximize-partial)
(bind-key 'all "C-S-Right" horizontal-toggle-maximize)
(bind-key 'all "C-S-Left" both-toggle-maximize)

;; See the binding for mouse button 2
;; to add geometry strings to this as well.
(bind-key 'all "C-S-Return" show-icon-list-menu)

(bind-key 'all "C-S-M-z" (lambda () (popup-menu 'menu-root-start #t)))

(set-click-delay! 150)

;;(define animation-ms-delay 100)

;; Fluid, cartoon-like
;(set-animation! '#(-.01 0 .01 .03 .08 .18 .3 .45 .60 .75 .85 .90 .94 .97 .99 1.0))

;; Linear, mechanical
;(set-animation! '#(0.1 0.2 0.3 0.4 0.6 0.7 0.8 0.9 1.0))

;; Fluid, cartoon-like, overshoots target
;(set-animation! '#(-.01 0 .01 .03 .08 .18 .3 .45 .60 .75 .85 .90 .94 .97 .99 1.01 1.02 1.01 1))

(bind-key 'all "C-M-KP_7" (lambda () (animated-move-to 0 0)))
(bind-key 'all "C-M-KP_9" (lambda () (animated-move-to -1 0)))
(bind-key 'all "C-M-KP_1" (lambda () (animated-move-to 0 -1)))
(bind-key 'all "C-M-KP_3" (lambda () (animated-move-to -1 -1)))

(bind-key 'all "C-M-KP_8" (lambda () (animated-move-to 'x 0)))
(bind-key 'all "C-M-KP_6" (lambda () (animated-move-to -1 'y)))
(bind-key 'all "C-M-KP_2" (lambda () (animated-move-to 'x -1)))
(bind-key 'all "C-M-KP_4" (lambda () (animated-move-to 0 'y)))

;; FIXGJB: modifiers interface could be better... mimic off Emacs?
;; FIXGJB: keys should be first class
(bind-key 'all "C-M-S-7" (lambda () (send-button-press 1)))
(bind-key 'all "C-M-S-8" (lambda () (send-button-press 2)))
(bind-key 'all "C-M-S-9" (lambda () (send-button-press 3)))

;;(bind-key 'all "C-M-S-4" (lambda () (send-key-press "Return")))
(bind-key 'all "C-M-S-4" (lambda () (X-synthetic-send-string "hello world")))

;; This one is experimental-- sends only the buttonpress event, no buttonrelease
(bind-key 'all "C-M-S-0" (lambda () (send-button-press 2 (get-window) #t #f)))

(bind-key 'all "C-M-S-n" (lambda () (write (get-window)) (newline)))

(bind-key 'all "C-M-S-s" (lambda () (toggle-stick)))

;; Hyper-w
(bind-key 'all "H-w" (lambda () (write (get-window)) (newline)))
;; Alt-w
(bind-key 'all "A-w" (lambda () (display "alt-w\n")))

;; FIXMS: maybe should be changed to use latest auto-raise stuff?
(if want-autoraise
    (use-modules (app scwm auto-raise))
    (window-style "*" #:auto-raise #t))

(if want-fvwm2-pager-module
    (begin
      (register-fvwm2-module-config "FvwmPager"
				    "*FvwmPagerBack grey76"
				    "*FvwmPagerFore black"
				    "*FvwmPagerHilight yellow"
				    "*FvwmPagerFont none"
				    "*FvwmPagerDeskTopScale 50"
				    "*FvwmPagerGeometry -0-0"
				    "*FvwmPagerLabel 0 Top"
				    "*FvwmPagerLabel 1 Bottom"
				    "*FvwmPagerSmallFont 5x8")
      ;; Actually run the pager. Make it manage desktops 0-2. Save the
      ;; module object in a variable so we can kill this specific pager
      ;; later.
      (define fvwm2-pager (run-fvwm2-module "FvwmPager"
					    '("0" "1")))
;; This shouldn't be necessary any longer
;;      (add-hook! shutdown-hook (lambda () (kill-fvwm2-module fvwm2-pager))))
      ))
    
(if want-fvwm2-winlist-module
    (begin
      (register-fvwm2-module-config 
       "FvwmWinList"
       "*FvwmWinListBack gray70"
       "*FvwmWinListFore Black"
       "*FvwmWinListFont -helvetica-bold-r-*-*-10-*-*-*-*-*-*-*"
       "*FvwmWinListAction Click1 Iconify -1,Focus"
       "*FvwmWinListAction Click2 Iconify"
       "*FvwmWinListGeometry -0+0"
       ;;     "*FvwmWinListAction Click3 Module FvwmIdent FvwmIdent"
       "*FvwmWinListUseSkipList")
      (define fvwm-winlist (run-fvwm2-module "FvwmWinList" '()))
      ;; work around a race condition in decorating FvwmWinList
      ;; and notifying FvwmWinList of the configure window event
      (add-timer-hook! (* 1000000 5) 
		       (lambda () 
			 (window-style "FvwmWinList"
				       #:use-style
				       desk-widget-on-top-no-titlebar)))
      ))

;;(kill-fvwm2-module fvwm-winlist)
;;(kill-all-fvwm2-modules)

;;; Dynamically loaded pie menus (just big regular menus now)
;;; 
;;;(define pie-menu-obj (dynamic-link "draw-pie-menu.so"))

;;;(define construct-pie-menu 
;;;  (dynamic-func "ConstructDynamicMenu" pie-menu-obj))

;;;(set! construct-menu-primitive construct-pie-menu)

(debug-display " *** `scwmrc' processed.\n")

(system 
 (string-append "ps auxww | grep -q \"^gjb .*xemacs -f gnus\" || " 
		HOME "/.xclients &"))

;; Remove the windows that are showing tail -f's on 
;; scwm error messages and .Xsession errors
(system "test -r ${HOME}/.tracepids && { kill `cat ${HOME}/.tracepids`; rm -f ${HOME}/.tracepids }")

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].