;;; File: <.scwmrc - 1999-04-26 Mon 11:43:24 EDT sds@gnu.org> ;;; $Id: sds.scwmrc,v 1.48 2000/02/20 23:12:10 gjb Exp $ ;;; Copyright (C) 1998 by Sam Shteingold. Released under the GPL2. ;;; Goal: to attract users. ;;; IMO, this should be the system.scwmrc. ;;; Main ideas: ;;; 1. look as nice as possible (e.g., if one item in the menu has ;;; mini-icon, all items will have one) ;;; 2. use as many features as possible (e.g., multiple decors etc), so ;;; that the users will be able to customize this thing easily. ;;; Most keybindings use H (hyper key). I have a w95 keyboard, so I use ;;; the "windows key" between the left Control and left Alt as Hyper. ;;; Put the following into ~/.xmodmaprc and call `xmodmap ~/.xmodmaprc` ;;; from your ~/.xsession or ~/.xinitrc (depending on whether you use ;;; xdm or xinit). ;;; keycode 115 = Hyper_L ;;; keycode 116 = Hyper_R ;;; add mod4 = Hyper_L Hyper_R ;;; Also, you probably want to add the following to your .emacs: ;;; (setq auto-mode-alist (cons ("\\.scwmrc\\'" . scwm-mode) auto-mode-alist)) ;; 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 ;;; ----------------------- (use-scwm-modules base face decor style winops winlist wininfo doc optargs std-menus titlebar-buttons winlist-menu xlock-menus wmconfig-menu flux prefs-menu fvwm-module key-mover netscape stringops animation placement virtual shutdown-opts defoption animated-iconify message-window gnome-hints) ; themes ;; communicate with GNOME ;; (set! *debug-gnome-hints* #t) (set! *gnome-desktop-number* 1) (set! *gnome-shade-animated* #t) (enable-gnome-hints) ;; user settable! (define want-pictures? #f) ;; initial desk size (set-desk-size! 2 2) ; X x Y ;;; print some information (display " *** Reading `scwmrc'...\n") (display (system-info-string)) (add-hook! startup-hook (lambda () (display " *** Available windows:\n") (for-each (lambda (ww) (write-all #t " - " ww "\n")) (list-all-windows)))) ;; (load user-init-file) ;;(set! xterm-command "rxvt ") ;;(set! xterm-command "gnome-terminal ") ;;(set! scwm-no-move-windows-on-exit #t) ;;(define mail-spool-dir (or (getenv "MAIL") ;; (string-append "/var/spool/mail/" (user-name)))) ;;; -------------------------- ;;; set some basic styles info ;;; -------------------------- ;;(define animation-delay 50) ;;(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 my-font (make-font "*helvetica*medium-r*10*")) (define my-font (make-font "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*")) (scwm-option-set! *menu-font* my-font) (scwm-option-set! *menu-title-font* my-font) ;;(define icon-font (make-font "fixed")) (set-icon-font! my-font) ; font12 (set! menu-bg-color (make-color "gray76")) (set! menu-text-color (make-color "black")) (set! menu-stipple-color (make-color "grey35")) (menu-style #:fg menu-text-color #:bg menu-bg-color #:stipple menu-stipple-color #:font my-font) ;(use-scwm-modules pie-menus) ;(set! menu-look scwm-menu-look) ; default, try `pie-menu-look' ;;(set-click-delay! 150) ; msec [150] (set-colormap-focus! 'focus) ; colormap focus == keyboard focus (set-rubber-band-mask! 255) (set-edge-scroll-delay! 100) (set-edge-move-threshold! 100) (set-edge-x-scroll! 0) (set-edge-y-scroll! 0) (set-edge-x-wrap! #f) (set-edge-y-wrap! #f) (shutdown-options #:switch-to-home-viewport 'shutdown-only #:move-windows-to-current-viewport 'shutdown-only) ;; (use-theme "woven") (scwm-option-set! *opaque-move-percent* 100) (scwm-option-set! *opaque-resize-percent* 100) ;;; ---------------- ;;; paths and images ;;; ---------------- (set! image-load-path (append! image-load-path (list "/usr/local/lib/X11/mini-icons/" "/usr/local/include/X11/pixmaps/"))) ; "/usr/X11R6/include/X11/bitmaps" ; "/usr/X11R6/include/X11/pixmaps" ; "/usr/share/pixmaps" ; "/usr/share/icons" ; "/usr/share/icons/mini" ; "/usr/local/lib/X11/mini-icons/" ; "/usr/local/include/X11/pixmaps/" (define audio-i (make-image "mini-audiovol.xpm")) (define biff-i (make-image "mini-xbiff.xpm")) (define bolt-i (make-image "mini-ray.xpm")) (define bomb-i (make-image "mini-bomb.xpm")) (define bomb2-i (make-image "mini-bomb2.xpm")) (define book2-i (make-image "mini-book2.xpm")) (define books-i (make-image "mini-books.xpm")) (define calc-i (make-image "mini-calc.xpm")) (define cd-i (make-image "mini-cdlabel.xpm")) (define clock-i (make-image "mini-clock.xpm")) (define cross-i (make-image "mini-cross.xpm")) (define ctd-i (make-image "mini-connect.xpm")) (define decor-i (make-image "mini-color-splotch.xpm")) (define dos-i (make-image "mini-bug2.xpm")) (define edit-i (make-image "mini-edit.xpm")) (define excl-i (make-image "mini-exclam.xpm")) (define eye-i (make-image "mini-eye.xpm")) (define eyes-i (make-image "mini-eyes.xpm")) (define fig-i (make-image "mini-paint.xpm")) (define fm-i (make-image "mini-filemgr.xpm")) (define fresh-i (make-image "mini-refresh.xpm")) (define games-i (make-image "mini-happy.xpm")) (define ghost-i (make-image "mini-gv.xpm")) (define gimp-i (make-image "mini-wilbur.xpm")) (define hamm-i (make-image "mini-hammer.xpm")) (define icon-i (make-image "mini-iconify.xpm")) (define lock-i (make-image "mini-lock.xpm")) (define lower-i (make-image "mini-lower.xpm")) (define mag-i (make-image "mini-xmag.xpm")) (define man-i (make-image "mini-manual.xpm")) (define manx-i (make-image "mini-xman.xpm")) (define max-i (make-image "mini-maximize2.xpm")) (define max1-i (make-image "mini-max1.xpm")) (define maxt-i (make-image "mini-maxtall.xpm")) (define maxw-i (make-image "mini-maxwide.xpm")) (define move-i (make-image "mini-move.xpm")) (define nscape-i (make-image "mini-nscape.xpm")) (define pdf-i (make-image "mini-pdf.xpm")) (define plot-i (make-image "mini-plot.xpm")) (define pref-i (make-image "mini-prefs.xpm")) (define quest-i (make-image "mini-question.xpm")) (define raise-i (make-image "mini-raise.xpm")) (define resize-i (make-image "mini-resize.xpm")) (define run-i (make-image "mini-run.xpm")) (define rxvt-i (make-image "mini-term.xpm")) (define save-i (make-image "mini-wm-save.xpm")) (define siag-i (make-image "mini-desktop.xpm")) (define stick-i (make-image "mini-stick.xpm")) (define stop-i (make-image "mini-stop.xpm")) (define term-i (make-image "mini-sh1.xpm")) (define turn-i (make-image "mini-turn.xpm")) (define windows-i (make-image "mini-windows.xpm")) (define x2-i (make-image "mini-x2.xpm")) (define xv-i (make-image "mini-xv.xpm")) (define xx-i (make-image "mini-x.xpm")) (define xxgdb-i (make-image "mini-bug1.xpm")) (if want-pictures? (define unknown-i (make-image "NoName.xpm"))) ;;; ------------------------- ;;; window styles/decorations ;;; ------------------------- (define std-d (make-decor "std")) (with-decor std-d ; font12 (title-style #:font my-font #:justify 'left #:relief 'raised) (border-style #:hidden-handles #f #:no-inset #t) (set-highlight-foreground! "PapayaWhip") (set-highlight-background!"tomato3")) ;; almost the same: "DarkOrange3" "OrangeRed3" "coral3" ;; 205 55 0 OrangeRed3 ;; 205 79 57 tomato3 ;; 205 91 69 coral3 ;; 205 102 0 DarkOrange3 ;; orig: "grey" "navyblue" ;; "white" "navyblue"; "navyblue" "IndianRed" (define lizard-d (make-decor)) (with-decor lizard-d (title-style #:font my-font #:justify 'left #:relief 'raised) (border-style #:hidden-handles #f #:no-inset #t #:pixmap "lizard2.xpm" #:inactive (list #:hidden-handles #f #:no-inset #t #:pixmap "lizard.xpm")) (set-highlight-foreground! "PapayaWhip") (set-highlight-background!"#a69938e31861")) (define grad-d (make-decor)) (with-decor grad-d (title-style #:font my-font #:justify 'left #:relief 'flat #:h-gradient (list 20 (list "OrangeRed3" 20) "OrangeRed3" "#3cb21c") #:inactive (list #:h-gradient (list 40 (list "grey50" 20) "grey50" "grey25"))) (border-style #:no-inset #f #:hidden-handles #f) (set-highlight-foreground! "PapayaWhip") (set-highlight-background!"coral3")) (define decor-list (list (cons "Standard" std-d) (cons "Lizard" lizard-d) (cons "Gradient" grad-d))) (define std-style (make-style #:fg menu-text-color #:bg menu-bg-color #:sticky-icon #f ; not needed with Gnome #:icon (if want-pictures? unknown-i #f) ; #f: no pics, just text #:icon-box (list 520 1 (x- 520) 200) ; (x- 70) 1 69 (y- 141)) #:border-width 3 #:mwm-border #t #:focus 'sloppy ; mouse #:use-decor std-d #:mwm-func-hint #t #:mwm-decor-hint #t #:hint-override #t #:decorate-transient #t #:PPosition-hint #f #:mini-icon term-i #:squashed-titlebar #f #:transient-placement-proc place-at-point)) (define desk-widget (make-style #:use-style std-style #:plain-border #t #:border-width 0 #:no-titlebar #t #:focus 'none #:sticky #t #:winlist-skip #t #:circulate-skip #t)) (define desk-widget-on-top (make-style #:use-style desk-widget #:kept-on-top #t)) ;; NOTE: you can use a string or a (make-image "filename.xpm") ;; after #:icon and #:mini-icon (window-style "*" #:use-style std-style) (window-style "lock" #:use-style desk-widget) (window-style "xload" #:use-style desk-widget) (window-style "osview" #:use-style desk-widget) (window-style "panel" #:use-style desk-widget #:focus 'sloppy) (window-style "xscreensaver" #:use-style desk-widget) (window-style "FvwmPager" #:use-style desk-widget-on-top) (window-style "xmailbox" #:use-style desk-widget-on-top #:mini-icon biff-i) (window-style "xbiff" #:use-style desk-widget-on-top #:mini-icon biff-i) (window-style "xcalc" #:icon "Calculator.xpm" #:mini-icon calc-i) ; [rx]calc (window-style "ical" #:icon "calendar.next.xpm" #:mini-icon bolt-i) (window-style "xman" #:icon "xman.xpm" #:mini-icon manx-i) (window-style "xmag" #:icon "mag_glass.xpm" #:mini-icon mag-i) (window-style "xplaycd" #:icon "CompactDisk.xpm" #:mini-icon cd-i) ; Music.xpm (window-style "replay" #:icon "Music.xpm" #:mini-icon audio-i) ; xamp (window-style "mpeg" #:icon "Music.xpm" #:mini-icon audio-i) (window-style "xmixer" #:icon "Music.xpm" #:mini-icon audio-i) (window-style "xv" #:icon "xv.color.xpm" #:mini-icon xv-i) (window-style "Netscape" #:icon "nscape.xpm" #:mini-icon nscape-i #:placement-proc (in-viewport-placement 1 1)) (window-style "gnuplot" #:icon "math4.xpm" #:mini-icon plot-i) (window-style "gimp" #:icon "wilbur.xpm" #:mini-icon gimp-i) (window-style "XDosEmu" #:icon "dosemu.xpm" #:mini-icon dos-i) (window-style "gmc" #:icon "FileManager.xpm" #:mini-icon fm-i) (window-style "xfig" #:icon "xpaint.xpm" #:mini-icon fig-i) ; Paint[1234]?.xpm (window-style "xterm" #:icon (if want-pictures? "xterm.xpm" #f) #:mini-icon term-i #:use-decor grad-d) (window-style "Terminal" #:icon (if want-pictures? "xterm.xpm" #f) #:mini-icon rxvt-i #:use-decor grad-d) (window-style "xxgdb" #:mini-icon xxgdb-i) ;(window-style "Toplevel" #:icon "toolbox.xpm") (window-style "gv" #:mini-icon ghost-i) (window-style "xpat2" #:mini-icon games-i) (window-style "iagno" #:mini-icon games-i #:icon "iagno.png") (window-style "freecell" #:mini-icon games-i) (window-style "gnomine" #:mini-icon games-i) (window-style "sol" #:mini-icon games-i) (window-style "gnotravex" #:mini-icon games-i) (window-style "gnome-stones" #:mini-icon games-i) (window-style "same-gnome" #:mini-icon games-i) (window-style "xmessage" #:mini-icon quest-i) (window-style "about" #:mini-icon quest-i) (window-style "gnomecc" #:mini-icon pref-i #:icon "control-center.png") (window-style "Config" #:icon "settings.xpm" #:mini-icon "mini-penguin.xpm") (window-style "gtkfind" #:mini-icon mag-i #:icon "find1.xpm") (window-style "ee" #:mini-icon eyes-i) (window-style "top" #:mini-icon eye-i) (window-style "Gnome*help*browser" #:mini-icon books-i) (window-style "helptool" #:mini-icon book2-i) (window-style "siag" #:mini-icon siag-i) (window-style "xpdf" #:mini-icon pdf-i) (window-style "telnet" #:mini-icon ctd-i) (window-style "acroread" #:mini-icon pdf-i) (window-style "Emacs" #:icon (if want-pictures? "gnu-animal.xpm" #f) #:mini-icon edit-i #:PPosition-hint #t #:use-decor lizard-d) (window-style "emacs*mbf" #:use-style desk-widget-on-top #:focus 'sloppy) ;TextEditor.xpm ; emacs.xbm ;(window-style "emacs: *Minibuf" #:use-style desk-widget-on-top) ;;; ------------- ;;; Various Menus ;;; ------------- (define menu-lisps (menu (list (menu-title "Lisps" #:extra-label "(H-f12)") menu-separator (menuitem "ACL" #:action (run-in-xterm "/home/sds/bin/acl")) (menuitem "CLISP" #:action (run-in-xterm "/home/sds/bin/cli")) (menuitem "CMUCL" #:action (run-in-xterm "/home/sds/bin/cmu")) (menuitem "GCL" #:action (run-in-xterm "/usr/bin/gcl")) menu-separator (menuitem "Guile" #:action (run-in-xterm "guile")) (menuitem "SCWM" #:action (run-in-xterm "scwmrepl"))))) (define start-xterm (run-in-xterm "bash")) ;; To later shut down the module, use kill-fvwm-module: ;; (kill-fvwm2-module fvwm-pager) ;;(set! *fvwm2-module-path* (append *fvwm2-module-path* ;; '("/usr/X11/lib/X11/fvwm2"))) ; (register-fvwm2-module-config "FvwmPager" ; "*FvwmPagerBack grey76" ; "*FvwmPagerFore black" ; "*FvwmPagerHilight navyblue" ; "*FvwmPagerFont none" ; "*FvwmPagerDeskTopScale 40" ; "*FvwmPagerLabel 0 Top" ; ;; "*FvwmPagerLabel 1 Bottom" ; "*FvwmPagerSmallFont 5x8") ; (define fvwm2-pager (run-fvwm2-module "FvwmPager" '("0" "0"))) (define menu-quit-verify (menu (list (menu-title "Really quit scwm?" #:image-left quest-i) menu-separator (menuitem "Yes" #:image-left excl-i #:action quit) (menuitem "No" #:image-left cross-i #:action noop) (menuitem "Restart scwm" #:image-left turn-i #:action (lambda () (restart "scwm"))) (menuitem "/usr/src/ scwm" #:image-left turn-i #:action (lambda () (restart "/usr/src/scwm/scwm/scwm"))) menu-separator ;;(menuitem "Start KDE" #:image-left xx-i #:action ;; (lambda () (restart "/opt/kde/bin/startkde"))) (menuitem "Start enlightenment" #:image-left "mini-fvwm.xpm" #:action (lambda () (restart "enlightenment"))) (menuitem "Start fvwm2" #:image-left "mini-fvwm.xpm" #:action (lambda () (restart "fvwm2"))) (menuitem "Start fvwm" #:image-left "mini-fvwm.xpm" #:action (lambda () (restart "fvwm")))))) (define menu-util (menu (list (menu-title "Utilities" #:image-left hamm-i #:extra-label "(H-f11)" #f) menu-separator (menuitem "&xterm" #:image-left term-i #:extra-label "(H-x)" #:action start-xterm) (menuitem "g&mc" #:image-left fm-i #:action "gmc") (menuitem "&root" #:image-left "mini-excl.xpm" #:action (run-in-xterm "su" "-T ROOT")) (menuitem "&emacs" #:image-left edit-i #:action "emacs") (menuitem "&gnuplot" #:image-left plot-i #:action (run-in-xterm "gnuplot")) (menuitem "Play &CD" #:image-left cd-i #:action "xplaycd") (menuitem "Play MP&3" #:image-left audio-i #:action "replay") (menuitem "MP&3 (gtk)" #:image-left audio-i #:action "gqmpeg") (menuitem "X &dos" #:image-left dos-i #:action "/usr/bin/dos -X") (menuitem "GTKFind" #:image-left mag-i #:action "gtkfind") menu-separator (menuitem "&Lisps" #:image-left bolt-i #:extra-label "(H-f12)" #:action menu-lisps) (menuitem "&Misc" #:image-left "mini-maze.xpm" #:action (menu (list (menuitem "&Top" #:image-left eye-i #:action "xterm +sb -T Top -n Top -e top") (menuitem "&Calculator"#:image-left calc-i #:action "xcalc") (menuitem "X&Mag" #:image-left mag-i #:action "xmag") (menuitem "Ca&lendar" #:image-left bolt-i #:action "ical") (menuitem "X&Biff" #:image-left biff-i #:action "xbiff") (menuitem "X&MailBox" #:image-left biff-i #:action "xmailbox") (menuitem "Clock (&D)" #:image-left clock-i #:action "xclock -digital") (menuitem "Clock (&A)" #:image-left clock-i #:action "oclock")))) ;; menu-separator ;; (menuitem "Desks" #:submenu menu-desk) menu-separator (menuitem "Exit scwm" #:image-left "mini-exit.xpm" #:action menu-quit-verify)) #:image-side "utilities-menu.xpm" #:color-bg-image-side "blue")) ;; #:image-bg "lizard2.xpm" (define menu-apps (menu (list (menu-title "Applications" #:image-left x2-i) menu-separator (menuitem "Acroread" #:image-left pdf-i #:action "acroread") (menuitem "Netscape" #:image-left nscape-i #:action "/usr/bin/netscape") ;; (menuitem "Mozilla" #:image-left nscape-i #:action ;; "/usr/bin/mozilla") (menuitem "GhostView" #:image-left ghost-i #:action "ghostview") (menuitem "GNU Emacs" #:image-left edit-i #:action "emacs") (menuitem "xxgdb/Emacs" #:image-left edit-i #:action "xxgdb -i /usr/src/emacs/src/.gdbinit -cd=/usr/src/emacs/src emacs") (menuitem "gdb/Emacs" #:image-left edit-i #:action "xterm -e gdb -cd=/usr/src/emacs/src -command=.gdbinit emacs") (menuitem "vim 5" #:image-left edit-i #:action "gvim") (menuitem "Siag Office" #:image-left siag-i #:action (menu (list (menuitem "siag" #:action "siag") (menuitem "pw" #:action "pw") (menuitem "egon" #:action "egon")))) (menuitem "WordPerfect" #:image-left edit-i #:action "/usr/local/wp/wpbin/xwp") (menuitem "LyX" #:image-left edit-i #:action "lyx") (menuitem "Xfig" #:image-left fig-i #:action "xfig") (menuitem "XPaint" #:image-left fig-i #:action "xpaint") (menuitem "The GIMP" #:image-left gimp-i #:action "gimp") (menuitem "XPDF" #:image-left pdf-i #:action "xpdf") (menuitem "EE" #:image-left eyes-i #:action "ee") (menuitem "XV" #:image-left xv-i #:action "xv")))) ;;(define menu-multimedia ;; (menu (list (menu-title "Multimedia") menu-separator menu-separator))) (define menu-games (menu (list (menu-title "Games" #f) ; #:image-left games-i menu-separator (menuitem "misc" #:action (menu (list (menuitem "XJewel" #:action "xjewel") (menuitem "XPat2" #:action "xpat2") (menuitem "Bogged" #:action "/home/sds/bin/bog") (menuitem "Nethack" #:action "nethack") (menuitem "XBill" #:action "xbill") (menuitem "XBL" #:action "xbl") (menuitem "Gagaga" #:action "xgal") (menuitem "Snow" #:action "xsnow") (menuitem "Fish" #:action "xfishtank")))) menu-separator (menuitem "Gnome" #:action (menu (list (menuitem "freecell" #:action "freecell") (menuitem "reversi" #:action "iagno") (menuitem "minesweeper" #:action "gnomine") (menuitem "robots" #:action "gnobots") (menuitem "mahjongg" #:action "mahjongg") (menuitem "same" #:action "same-gnome") (menuitem "solitaire" #:action "sol"))))))) ;;; ------------ ;;; Window menus ;;; ------------ (define (icon-list) (show-window-list-menu #f #f #:only iconified-window? #:show-geometry #t)) (define (winlist) (show-window-list-menu #f #f #:show-geometry #t)) (define menu-window-ops (menu (list (menu-title "Window Operations" #:image-left windows-i #:extra-label "(H-f2)") menu-separator (menuitem "&Move" #:image-left move-i #:extra-label "(H-f7)" #:action interactive-move) (menuitem "Re&size" #:image-left resize-i #:extra-label "(H-f8)" #:action interactive-resize) (menuitem "R&aise" #:image-left raise-i #:extra-label "(H-RET)" #:action raise-window) (menuitem "&Lower" #:image-left lower-i #:extra-label "(H-RET)" #:action lower-window) (menuitem "&Iconify" #:image-left icon-i #:extra-label "(H-m)" #:action animated-toggle-iconify) (menuitem "&Sticky" #:image-left stick-i #:action toggle-stick) (menuitem "Ma&ximize" #:image-left max1-i #:action toggle-maximize-both) (menuitem "&Tall" #:image-left maxt-i #:action toggle-maximize-vertical) (menuitem "&Wide" #:image-left maxw-i #:action toggle-maximize-horizontal) (menuitem "S&hade" #:image-left bolt-i #:action animated-toggle-window-shade) menu-separator (menuitem "&On-top" #:image-left eyes-i #:action toggle-on-top) ;; (menuitem "&Print" #:image-left run-i #:action print-window) (menuitem "In&fo" #:image-left quest-i #:extra-label "(H-i)" #:action window-info) (menuitem "Decorations" #:image-left decor-i #:action (menu (map (lambda (dec) (menuitem (car dec) #:action (lambda () (window-style "*" #:use-decor (cdr dec))))) decor-list))) menu-separator (menuitem "&Close" #:image-left cross-i #:extra-label "(H-f4)" #:action close-window) (menuitem "&Delete" #:image-left bomb2-i #:action delete-window) (menuitem "&Destroy" #:image-left bomb-i #:action destroy-window) menu-separator (menuitem "Switch to..." #:image-left turn-i #:extra-label "(H-f3)" #:action winlist) (menuitem "Re&fresh" #:image-left fresh-i #:extra-label "(H-r)" #:action refresh) (menuitem "Reca&pture" #:image-left fresh-i #:extra-label "(H-5)" #:action recapture)))) (define (make-small-window-ops-menu ww) (menu (list (menu-title "Small Ops" #:image-left windows-i) menu-separator (menuitem "&Move" #:image-left move-i #:extra-label "(H-f7)" #:action interactive-move) (menuitem "Re&size" #:image-left resize-i #:extra-label "(H-f8)" #:action interactive-resize) (menuitem (if (iconified-window? ww) "Unmi&nimize" "Mi&nimize") #:extra-label "(H-m)" #:image-left icon-i #:action animated-toggle-iconify) (menuitem (if (maximized? ww) "Unma&ximize" "Ma&ximize") #:image-left max1-i #:action toggle-maximize-both) menu-separator (menuitem "Info" #:image-left quest-i #:extra-label "(H-i)" #:action (lambda () (window-info ww))) (menuitem "More" #:image-left max-i #:action (menu (list (menuitem "&Raise" #:extra-label "(H-RET)" #:action raise-window) (menuitem "&Lower" #:extra-label "(H-RET)" #:action lower-window) (menuitem (if (sticky-window? ww) "Un&stick" "&Stick") #:action toggle-stick) (menuitem (if (shaded-window? ww) "Unwindow-S&hade" "Window-S&hade") #:action toggle-window-shade) (menuitem (if (kept-on-top? ww) "UnKeep On Top" "Keep On Top") #:action toggle-on-top)))) (menuitem "Decorations" #:image-left decor-i #:action (menu (map (lambda (dec) (menuitem (car dec) #:action (lambda () (style-one-window ww #:use-decor (cdr dec))))) decor-list))) menu-separator (menuitem "&Close" #:image-left cross-i #:extra-label "(H-f4)" #:action close-window) (menuitem "&Delete" #:image-left bomb2-i #:action delete-window) (menuitem "&Destroy" #:image-left bomb-i #:action destroy-window)))) (define menu-help (menu (list (menuitem "&About scwm" #:image-left excl-i #:action (show-mesg "Scheme Configurable Window Manager.\\n\ Based on fvwm; uses guile. Distributed under the GPL2.\\n\ See http://web.mit.edu/mstachow/www/scwm.html for details.")) (menuitem "&Help scwm" #:image-left quest-i #:action (show-mesg "No scwm help yet. Sorry.")) (menuitem "&Gnome Help" #:image-left books-i #:action "gnome-help-browser") (menuitem "&XMan" #:image-left manx-i #:action "xman") (menuitem "Help&Tool" #:image-left book2-i #:action "helptool")))) (define menu-root-start (menu (list (menu-title "Start" #:image-left "mini-start.xpm" #:extra-label "(H-z)") menu-separator (menuitem "&New shell" #:image-left term-i #:extra-label "(H-x)" #:action start-xterm) (menuitem "Midnight &Commander" #:image-left "mini-display.xpm" #:action "xterm +sb -e mc") (menuitem "&Applications" #:image-left x2-i #:action menu-apps) (menuitem "&Utilities" #:image-left hamm-i #:action menu-util) (menuitem "H&osts" #:image-left ctd-i #:action (make-hosts-menu ; "stormbringer" "right.ml.org" '(("mute" . "rlogin") ("eho" . "rlogin") "delysid.gnu.org" "mescaline.gnu.org" ("melange.gnu.org" . "rlogin") ("huis-clos.mit.edu" . "ssh") ("cellar.goems.com" . "ssh -P") ("fatty.goems.com" . "ssh -P") "central1" "eagle_one" "gandalf" "nether.net"))) ;; (menuitem "&Multimedia" #:image-left "mini-audiovol.xpm" ;; #:action menu-multimedia) (menuitem "&Games" #:image-left games-i #:action menu-games) menu-separator (menuitem "&Window Operations" #:image-left windows-i #:extra-label "(H-f2)" #:action menu-window-ops) (menuitem "&Preferences" #:image-left pref-i #:action (menu-prefs)) (menuitem "WM Conf&ig (RH5)" #:image-left xx-i ; #:extra-label #:action (make-wmconfig-menu)) menu-separator (menuitem "&Screensaver" #:image-left save-i #:action (make-xlock-menu #f)) (menuitem "Lock Scree&n" #:image-left lock-i #:action (make-xlock-menu #t)) menu-separator (menuitem "Help" #:image-left man-i #:action menu-help) (menuitem "E&xit scwm" #:image-left stop-i #:action menu-quit-verify)) #:image-side "scwm-color.xpm" #:color-bg-image-side menu-stipple-color)) ;;; ----------- ;;; keybindings ;;; ----------- (define (popup-small-ops) (popup-menu (make-small-window-ops-menu (get-window)))) (define (popup-root-start) (popup-menu menu-root-start)) (define (popup-ops) (popup-menu menu-window-ops)) (define (popup-lisps) (popup-menu menu-lisps)) (define (popup-util) (popup-menu menu-util)) ;; now set some mouse and key bindings ;; first our root menus (bind-mouse 'root 1 popup-root-start) (bind-mouse 'root 2 popup-ops) (bind-mouse 'root 3 winlist) ;;(bind-mouse 'root 3 popup-applications) ;;(bind-mouse 'root "M-3" (lambda () (popup-menu menu-desk))) ;; operations on parts of the window (bind-mouse '(frame-corners frame-sides) 2 popup-small-ops) (define (move-or-shade) (case (mouse-event-type) ((double-click) (animated-toggle-window-shade)) (else (move-or-raise)))) (bind-mouse 'title 1 move-or-shade) (bind-mouse 'title 2 lower-window) (bind-mouse '(title frame-corners frame-sides) 3 popup-small-ops) ;; some stuff for icons (define (move-or-deiconify) (case (mouse-event-type) ((motion) (interactive-move)) ((double-click) (animated-deiconify)))) (bind-mouse 'icon 1 move-or-deiconify) (bind-mouse 'icon 2 animated-deiconify) (bind-mouse 'icon 3 popup-small-ops) (bind-mouse 'all "H-1" toggle-raise) (bind-mouse 'all "H-2" interactive-move) (bind-mouse 'all "H-3" interactive-resize) ;;; ----------------- ;;; Title bar buttons ;;; ----------------- (define prog-face (make-face '((relief raised)) '((pixmap mini-program-icon)))) (define edit-face (make-face '((relief raised)) '((pixmap "mini-edit.xpm")))) (define term-face (make-face '((relief raised)) '((pixmap "mini-term.xpm")))) ;;(define sticky-button-face ;; (make-face '((relief flat)) '((pixmap "mini-hbars-full.xpm")))) ;;(define sysutils-button-face ;; (make-face '((relief flat)) '((pixmap "mini-lightbolt-full.xpm")))) ;;(define close-button-face ;; (make-face '((relief raised)) '((pixmap "mini-stylized-x-full.xpm")))) ;;(define tall-maximize-button-face ;; (make-face '((relief flat)) '((pixmap "mini-exp-windows-full.xpm")))) ;;(define iconify-button-face ;; (make-face '((relief flat)) '((pixmap "mini-shrink-windows-full.xpm")))) ;;; these come from relief-examples ;;(define big-box-face ; big box ;; (make-face '((relief raised)) ;; '((relief-pattern ((25 25 #t) (25 75 #t) (75 75 #f) ;; (75 25 #f) (25 25 #t)))))) (define small-box-face ; small box (make-face '((relief raised)) '((relief-pattern ((40 40 #t) (60 40 #t) (60 60 #f) (40 60 #f) (40 40 #t)))))) ;;(define tall-box-face ; tall box ;; (make-face '((relief raised)) ;; '((relief-pattern ((40 25 #t) (60 25 #t) (60 75 #f) (40 75 #f) ;; (40 25 #t)))))) ;;(define dot-face ; dot ;; (make-face '((relief raised)) ;; '((relief-pattern ((45 45 #t) (55 45 #t) (55 55 #f) (45 55 #f) ;; (45 45 #t)))))) ;;(define stack2-face ; 2 stacked rectangular panels like stills ;; (make-face '((relief raised)) ; of a window being maximized. ;; '((relief-pattern ((80 15 #f) (85 70 #f) (30 70 #f) (55 70 #f) ;; (55 85 #f) (15 85 #f) (15 55 #t) (30 55 #t) ;; (30 70 #t) (30 15 #t) (85 15 #t)))))) ;;(define stack3-face ; 3 stacked square panels like stills ;; (make-face '((relief raised)) ; 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 big-box-arrow-face ; Big Box with arrow to little box (iconify) ;; (make-face '((relief raised)) ;; '((relief-pattern ((20 20 #t) (20 70 #t) (70 70 #f) (70 20 #f) ;; (20 20 #t) (60 60 #f) (60 50 #f) (60 60 #f) ;; (50 60 #f) (60 60 #f) (60 80 #f) (80 80 #f) ;; (80 60 #f) (60 60 #f)))))) ;;(define std-X-face ; Standard X ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((20 20 #t) (30 20 #t) (50 40 #t) (70 20 #t) (80 20 #t) ;; (80 30 #f) (60 50 #f) (80 70 #t) (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 funky-X-face ; Funky X ;; (make-face '((relief raised)) ;; '((relief-pattern ((26 29 #t) (34 21 #t) (50 35 #t) (70 21 #t) ;; (79 29 #t) (63 48 #f) (79 65 #t) (70 75 #f) ;; (50 61 #f) (34 75 #f) (26 65 #f) (44 48 #t) ;; (26 29 #f)))))) (define stylized-X-face ; Stylized X (make-face '((relief raised)) '((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 small-up-triangle-face ; small up triangle ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((50 35 #t) (65 65 #f) (35 65 #f) (50 35 #t)))))) ;;(define small-down-triangle-face ; small down triangle ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((50 65 #t) (35 35 #t) (65 35 #t) (50 65 #f)))))) ;;(define large-up-triangle-face ; large up triangle ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((50 25 #t) (75 75 #f) (25 75 #f) (50 25 #t)))))) ;;(define large-down-triangle-face ; large down triangle ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((50 75 #t) (25 25 #t) (75 25 #t) (50 75 #f)))))) ;;(define up-arrow-face ; Up Arrow ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((40 80 #t) (40 50 #t) (20 50 #t) (50 20 #t) (80 50 #f) ;; (60 50 #f) (60 80 #f) (40 80 #f)))))) ;;(define down-arrow-face ; Down Arrow ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((40 20 #t) (40 50 #t) (20 50 #t) (50 80 #t) (80 50 #f) ;; (60 50 #f) (60 20 #f) (40 20 #t)))))) ;;(define left-arrow-face ; Left arrow ( <- ) ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((80 40 #t) (50 40 #t) (50 20 #t) (20 50 #t) (50 80 #f) ;; (50 60 #f) (80 60 #f) (80 40 #f)))))) ;;(define right-arrow-face ; Right arrow ( -> ) ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((20 40 #t) (50 40 #t) (50 20 #t) (80 50 #t) (50 80 #f) ;; (50 60 #f) (20 60 #f) (20 40 #t)))))) ;;(define left-right-arrow-face ; Horizontal Line with arrowheads on ;; (make-face '((relief raised)) ; left and right ( <-> ) ;; '((relief-pattern ;; ((10 50 #t) (35 25 #t) (35 40 #t) (65 40 #t) (65 25 #t) ;; (90 50 #t) (65 75 #f) (65 60 #f) (35 60 #f) (35 75 #f) ;; (10 50 #f) (10 50 #t)))))) (define up-down-arrow-face ; Vertical Line with arrowheads on (make-face '((relief raised)) ; top and bottom '((relief-pattern ((50 10 #t) (25 35 #t) (40 35 #t) (40 60 #t) (25 60 #t) (50 85 #t) (75 60 #f) (60 60 #f) (60 35 #f) (75 35 #f) (50 10 #f) (50 10 #t)))))) ;;(define slash-arrow-face ; Diagonal Line with arrowheads on ;; (make-face '((relief raised)) ; top and bottom ( / ) ;; '((relief-pattern ((80 15 #t) (45 15 #t) (55 25 #t) (25 55 #t) ;; (15 45 #t) (15 80 #t) (50 80 #f) (40 70 #f) ;; (70 40 #f) (80 50 #f) (80 15 #f)))))) ;;(define backslash-arrow-face ; Diagonal Line with arrowheads on ;; (make-face '((relief raised)) ; top and bottom ( \ ) ;; '((relief-pattern ;; ((55 15 #f) (45 25 #f) (75 55 #f) (85 45 #f) (85 80 #f) ;; (50 80 #f) (60 70 #t) (30 40 #t) (20 50 #t) (20 15 #t) ;; (55 15 #t) (55 15 #f)))))) ;;(define small-lightning-face ; Small Lightning Bolt (skinny at both ends) ;; (make-face '((relief raised)) ;; '((relief-pattern ((70 15 #f) (30 55 #t) (50 55 #f) (40 85 #t) ;; (80 45 #f) (60 45 #t) (70 15 #f)))))) (define big-lightning-face ; Big Lighting Bolt (Fat at top, (make-face '((relief raised)) ; 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 nested-right-angles-face-1 ; Nested Right Angles (looks kinda crappy) ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((10 0 #t) (80 0 #t) (80 10 #t) (80 80 #f) (0 80 #f) ;; (0 60 #t) (10 65 #t) (70 65 #f) (70 0 #f) (55 0 #t) ;; (55 10 #t) (55 55 #f) (10 55 #f)))))) ;;(define nested-right-angles-face-2 ; Nested Right Angles (looks nice) ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((0 0 #t) (0 20 #t) (20 20 #f) (20 0 #f) (0 0 #t) (0 25 #t) ;; (25 25 #t) (25 0 #t) (55 0 #t) (55 55 #f) (0 55 #f) (0 60 #t) ;; (60 60 #t) (60 0 #t)))))) (define horizontal-bar4-face ; 4 Horizontal bars (sticky) (make-face '((relief raised)) '((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)))))) ;;(define expanding-windows-face ; Expanding Windows ;; (make-face '((relief raised)) ; (iconify -- looks NICE) ;; '((relief-pattern ;; ((60 40 #t) (60 80 #f) (15 80 #f) (15 40 #t) (60 40 #t) ;; (40 40 #t) (40 25 #t) (75 25 #t) (75 60 #f) (60 60 #f) ;; (75 60 #f) (75 40 #f) (85 40 #f) (85 15 #f) (60 15 #t) ;; (60 25 #t)))))) ;;(define letter-Z-face ; the letter "Z" ;; (make-face '((relief raised)) ;; '((relief-pattern ;; ((80 80 #f) (22 80 #f) (80 40 #f) (70 25 #f) (30 25 #f) ;; (20 35 #f) (20 30 #t) (30 20 #t) (70 20 #t) (80 30 #t) ;; (20 75 #t) (80 75 #t)))))) (add-left-button prog-face popup-small-ops) (add-left-button horizontal-bar4-face toggle-stick) (add-left-button big-lightning-face animated-toggle-window-shade) (add-right-button stylized-X-face close-window) (add-right-button up-down-arrow-face toggle-maximize-vertical) (add-right-button small-box-face animated-iconify) ;; should be after the buttons ;(with-decor lizard-d (set-button-face! 1 edit-face)) ; emacs ;(with-decor grad-d (set-button-face! 1 term-face)) ; xterms ;; Just for test bind, unbind-mouse ;;(unbind-mouse 'all "C-S-Mouse1") ;;(unbind-mouse 'all "C-S-M-2") ;;(bind-mouse 'all "C-S-Mouse-1" show-icon-list-menu) (bind-key 'all "H-F1" popup-util) (bind-key 'all "H-F2" popup-ops) (bind-key 'all "H-F3" winlist) (bind-key 'all "H-F4" (lambda () (close-window (get-window)))) (bind-key 'all "H-F5" icon-list) (bind-key 'all "H-F6" popup-small-ops) (bind-key 'all "H-F7" interactive-move-window-with-pointer) (bind-key 'all "H-F8" interactive-resize-window-with-pointer) (bind-key 'all "H-F10" popup-root-start) (bind-key 'all "H-F11" popup-util) (bind-key 'all "H-F12" popup-lisps) (bind-key 'all "H-q" quit) (bind-key 'all "H-z" popup-root-start) ;; rotate the current window with the keyboard (bind-key 'all "H-Tab" (lambda () (next-window #:except iconified-window?))) (key-mouse-moves "H" 5 "h" "j" "k" "l") (key-mouse-moves "H" 1 "y" "u" "i" "o") (key-viewport-moves "H" 100 "Left" "Down" "Up" "Right") (bind-key 'all "H-Home" (lambda () (set-viewport-position! 0 0))) (bind-key 'all "H-End" (lambda () (set-current-desk! 0))) ;; travel around the desks (bind-key 'all "H-f" (lambda () (set-current-desk! (+ (current-desk) 1)))) (bind-key 'all "H-b" (lambda () (set-current-desk! (- (current-desk) 1)))) (bind-key 'all "H-r" refresh) (bind-key 'all "H-5" recapture) (bind-key 'all "H-x" start-xterm) (set! *netscape-new-window* #t) (bind-key 'all "H-w" netscape-goto-cut-buffer-url) ;;(define root-size-x (car (display-size))) ;;(define root-size-y (cadr (display-size))) ;;(putenv (string-append "height=" (number->string root-size-y))) ;;(putenv (string-append "width=" (number->string root-size-x))) ;; (define (percent-display x y) (list (%x x) (%y y))) (bind-key 'all "H-m" animated-toggle-iconify) (bind-key 'all "H-Return" toggle-raise) (bind-key 'all "H-p" toggle-maximize-vertical-part) (bind-key 'all "H-S-Right" toggle-maximize-horizontal) (bind-key 'all "H-S-Left" toggle-maximize-both) (bind-key 'all "H-i" (lambda () (window-info (current-window-with-pointer)))) ;(define (message-show-error . args) ; (message "scwm error:" ; (with-output-to-string ; (lambda () (map (lambda (arg) (display " ") (write arg)) args))))) ;(add-hook! error-hook message-show-error) ;; Fluid, cartoon-like (set-animation! '#(0 .01 .03 .08 .18 .3 .45 .60 .75 .85 .90 .94 .97 .99 1)) ;; Linear, mechanical ;(set-animation! '#(0.1 0.2 0.3 0.4 0.6 0.7 0.8 0.9 1.0)) (bind-key 'all "H-KP_1" (lambda () (with-window (get-window) (animated-move-to 0 (y- (w%y 100)))))) (bind-key 'all "H-KP_2" (lambda () (with-window (get-window) (animated-move-to #f (y- (w%y 100)))))) (bind-key 'all "H-KP_3" (lambda () (with-window (get-window) (animated-move-to (x- (w%x 100)) (y- (w%y 100)))))) (bind-key 'all "H-KP_4" (lambda () (animated-move-to 0 #f))) (bind-key 'all "H-KP_6" (lambda () (with-window (get-window) (animated-move-to (x- (w%x 100)) #f)))) (bind-key 'all "H-KP_7" (lambda () (animated-move-to 0 0))) (bind-key 'all "H-KP_8" (lambda () (animated-move-to #f 0))) (bind-key 'all "H-KP_9" (lambda () (with-window (get-window) (animated-move-to (x- (w%x 100)) 0)))) ;;(bind-key 'all "C-M-S-7" (lambda () (send-button 1))) ;;(bind-key 'all "C-M-S-8" (lambda () (send-button 2))) ;;(bind-key 'all "C-M-S-9" (lambda () (send-button 3))) ;;(bind-key 'all "C-M-S-4" (lambda () (send-key "Return"))) ;(bind-key 'all "C-M-S-s" (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 2 (get-window) #t #f))) ;; Hyper-w ;(bind-key 'all "H-w" (lambda () (write (get-window)) (newline))) ;; Alt-w ;; (bind-key 'all "A-w" (lambda () (display "alt-w\n"))) ;;; Need M_FOCUS_CHANGE for auto-raise ;;(use-modules (app scwm module-types)) ;;; if want auto-raise, uncomment this ;;(define broadcast-hook ;; (lambda (event a1 a2 a3 a4 a5 a6 a7) ;; (if (= event M_FOCUS_CHANGE) ;; (let ((window (id->window a1))) ;; (if window (raise-window window)))))) ;;; menu-item test cases ;(define sticky-menu-item (make-menu-item "Sticky" toggle-stick "C-S-F8" (make-image "mini-unkno.xpm") #f #f "sticky")) ;(define move-menu-item (make-menu-item "Move" interactive-move "C-S-F7" (make-image "mini-move.xpm") #f #f "move")) ;(define resize-menu-item (make-menu-item "Resize" interactive-resize "C-S-F8" (make-image "mini-resize.xpm") #f #f "resize")) ;(define a-menu (make-scwm-menu (list sticky-menu-item move-menu-item resize-menu-item))) (display " *** `scwmrc' processed.\n")