;;;;;;;;;;;;;;;; ~/spare-blue.scwmrc ;;;;;;;;;;;;;;;; -*- scwm -*- ;;;;;;;;;;;;;;;; ------------------- ;;;;;;;;;;;;;;;; ;;; This is a .scwmrc configuration file for SCWM, a window manager. ;;; Called `spare-blue', this has a simple, spare theme and blue backgrounds. ;;; Robert J. Chassell ;;; 1999 Aug 21, 1999 Sep 8, 1999 Nov 13, 1999 Dec 9 ;; ==> Note that font sizes are for a 1280x1024 screen. ;; You may have to adjust sizes for your resolution. ;;--------------;; ;; CVS snapshot ;; ;;--------------;; ;; This file was tested with the CVS snapshot of 1999 Sep 8 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;; To obtain a CVS snapshot of the SCWM development sources ;; execute the following at your shell prompt. ;; Be warned that development sources often but don't always work! ;; I keep my scwm sources in /u/scwm. ;; The first time you obtain a snapshot do the following ;; mkdir /u ;; cd /u ;; export CVSROOT=':pserver:anoncvs@scwm.mit.edu:/anoncvs' ;; cvs login ;; ## type `anoncvs' as the password at the `CVS password:' prompt ;; cvs get scwm ;; The second and subsequent times, to update your CVS snapshot, do: ;; cd /u/scwm ;; export CVSROOT=':pserver:anoncvs@scwm.mit.edu:/anoncvs' ;; cvs login ;; ## type `anoncvs' as the password at the `CVS password:' prompt ;; cvs update -Pd ;; Try these compile commands to build scwm: ;; ./autogen.sh; ;; ./ltconfig --cache-file=./config.cache --with-gcc --with-gnu-ld ; ;; ./ltmain.sh i686-pc-linux-gnu; ./configure --enable-maintainer-mode ; ;; env CFLAGS='-Wall -W' make -k" ;; [su root] ;; make install ;; or try: ;; ;; ./configure --enable-permissive --prefix=/usr/local && make -k ;; [su root] ;; make install ;; or try: ;; ;; ./configure --enable-maintainer-mode --prefix=/usr \ ;; --enable-permissive --with-cassowary && make -k ;; [su root] ;; make install ;; On my system, SCWM-related files are in: ;; ;; /usr/local/share/scwm/ ;; particularly ;; /usr/local/share/scwm/modules/app/scwm/ ;; /usr/local/share/scwm/pixmaps ;; /usr/local/share/scwm/themes ;; ;; as well as ;; /usr/local/lib/ ;; /usr/local/include/ ;; /usr/local/bin/ ;; ;; My sources are in /u/scwm ;; Samples in /u/scwm/sample.scwmrc/ ;; Themes in /u/scwm/themes ;; Other scm files are in: ;; ;; /usr/lib/elk/scm ;; /usr/lib/scm ;; /usr/share/slib ;;---------------;; ;; Starting SCWM ;; ;;---------------;; ;; To start SCWM, place the following in your ~/.xsession file: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; #! /bin/bash ;; ;; exec scwm -f ~/spare-blue.scwmrc ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Or run a trace when you start SCWM; use this `exec' command: ;; ;; exec strace -etrace=open /usr/bin/scwm -f ~scwm/spare-blue.scwmrc \ ;; --segv-just-stop ;; then run `startx' from your shell prompt. ;; If you wish to use X windows display :0, ;; set your color depth to 32, ;; and record errors and other information in a file called X-log, ;; run: ;; startx -- :0 -bpp 32 > X-log 2>&1 ;; ;; On my system, this SCWM configuration takes 30 seconds to start. ;;-------;; ;; Gnome ;; ;;-------;; ;; If you want to use the gnome panel, stick ;; "panel &" in your $HOME/.xclients file (and be sure it is u+x) ;; import scwm modules we need for the startup animation (use-scwm-modules base message-window gnome-hints) ;; do this early, since gnome times out in 10 seconds (enable-gnome-hints) ;; Initialize various window styles for GNOME support. ;; This handles desktop icons, splash screens, and the panel. (gnome-install-window-styles) ;;---------------------------;; ;; display a startup message ;; ;;---------------------------;; ;; Do this very early so people do not wait too long. ;; This message takes ten seconds to appear on my machine. ;; First we must import the scwm modules that provide the requisit services. ;; The message-window module imports base.scm and three other modules. (use-scwm-modules message-window) (define font12 (make-font "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*")) (set-icon-font! font12) (scwm-option-set! *window-font* "-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*") ;; Set message-window-style (message-window-style default-message-window #:font *message-window-font* #:fg "white" #:bg "blue") ;; Display startup message for 15 seconds, after which it goes away ;; If you have a faster machine, you may want to shorten the time. (display-message-briefly "Starting SCWM ... this takes thirty seconds on my machine ... " 15) ;;-----------------------------------;; ;; ---- Import the scwm modules ---- ;; ;;-----------------------------------;; ;; Import the scwm modules that run the window manager. ;; You can use one or other of the commands: use-scwm-modules or use-modules. ;; The latter command requires that you specify the subdirectories ;; under the modules directory under which the specific modules are ;; are located. Thus, the command (use-modules (app scwm base)) ;; loads the base.scm module from /usr/local/share/scwm/modules/app/scwm/ ;; As you can see, the top level directory is ;; /usr/local/share/scwm/modules/ ;; The use-scwm-modules command presumes the desired modules are in the ;; /usr/local/share/scwm/modules/app/scwm/ directory. ;; List modules in alphabetical order, so it is easier to keep track of them. ;; Am probably loading more than I need. (use-scwm-modules advice animated-edge-moves animated-iconify animation auto-raise background base basic-styles constraint-investigator constraints decor defoption describe dir-focus doc face file flash-window flux flux-gtk fvwm-compat fvwm-eval fvwm-module gnome-hints group gtk highlight-current-window image-path-suggestor key-mover last-mapped-window listops menus-extras message-window modifier-key-bindings ;; netscape optargs path-cache placement preferences primopts prompt-color property-respond quote register register send-string shove-window simple-constraints snap-constraints std-menus stringops style stylist synth-events task-switcher theme-impl themes tile time-convert titlebar-buttons ui-constraints ui-constraints-buttons ui-constraints-classes ui-constraints-composition ui-constraints-gdk-drawing constraint-investigator ui-constraints-toggle-menu undo virtual wavplay window-configuration window-selection wininfo winlist winlist-menu winops winops-menu xlock-menus xprop-extras ) ;; Example of `use-modules' command ;; [This example does not load as many modules as the command above.] ;; (use-modules ;; (app scwm auto-raise) ;; (app scwm base) ;; (app scwm decor) ;; (app scwm desk-background) ;; (app scwm face) ;; (app scwm flux) ;; (app scwm fvwm-module) ;; (app scwm module-types) ;; (app scwm style) ;; (app scwm themes) ;; (app scwm wininfo) ;; (app scwm winlist) ;; (app scwm winops) ;; (app scwmp references)) ;;-------------------------------------;; ;; set window configuration at startup ;; ;;-------------------------------------;; ;; These commands replace most of what goes into a ~/.xinitrc or ~/.xsession ;; file. ;; ==> Note that font sizes are for a 1280x1024 screen. ;; You may have to adjust sizes for your resolution. ;; Blue is restful on my eyes; shows less flicker (to which I am sensitive). (set-background-color! "Navy") ;; for analog clock in upper right (execute "xclock -analog -bg navy -fg white -hd white -hl white \ -update 1 -geometry 80x80-130+5") ;; for digital clock in upper left (execute "xclock -digital -bg navy -fg white -hd white -hl white \ -update 1 -geometry +0+0") ;; for GMT digital clock in upper left (scwm-system "TZ=GMT0 xclock -digital -bg navy -fg white -hd white -hl white \ -update 1 -geometry +202+0&") ;; Other clock information is located in: ;; /usr/local/share/scwm/modules/app/scwm/ScwmClock.scm ;; Create some xterms. Note the name for the tall xterm; ;; that is so it is easy for me to pick from an icon list. (execute "xterm -T 80x24 -n 80x24 -bg mediumblue \ -fg white -cr white -geometry 80x24+0+75") (execute "xterm -T 80x74 -n '|| 80x74 ||' -bg mediumblue \ -fg white -cr white -geometry 80x74+450+10 -iconic") ;; Here are other programs that are usually run from ~/.xinitrc (execute "xrdb ~/.Xresources > /dev/null") ;; The contents of my .Xresources file are: ;; ;; *Label*shadowWidth: 3 ;; ;; XTerm*jumpScroll: true ;; XTerm*scrollBar: true ;; XTerm*cutToBeginningOfLine: false ;; XTerm*cursorColor: white ;; XTerm*saveLines: 800 ;; ;; Emacs*background: darkblue ;; Emacs*foreground: white ;; Emacs*cursorColor: white ;; Emacs*pointerColor: white ;; Emacs*bold.AttributeBackground: dodger blue ;; Emacs*bold.AttributeForeground: white ;; Emacs.MenuBar: on ;; My preferred keymap is: /usr/share/keymaps/i386/qwerty/emacs2.map.gz ;; This emulates it in X (execute "xmodmap -e 'clear Lock'") (execute "xmodmap -e 'add Control = Caps_Lock'") (execute "xmodmap -e 'keysym Tab = Tab'") (execute "xmodmap -e 'keycode 22 = BackSpace'") (execute "xmodmap -e 'keycode 107 = Delete'") ;; Fonts ;; For Emacs; extract from: /usr/local/src/intlfonts-1.0.tar.gz ;; Others that could be loaded include: ;; Asian Chinese-BIG Chinese Ethiopic Japanese-BIG Japanese Korean ;; For the GIMP, put Type 1 and Speedo fonts first. (execute "xset fp+ /usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/Speedo/,/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/freefont/,/usr/X11R6/lib/X11/fonts/sharefont/,/usr/local/src/intlfonts/European,/usr/local/src/intlfonts/Asian,/usr/local/src/intlfonts/Misc") (execute "xset fp rehash") ;;;; end set window configuration at startup ;;;; ;;--------------------------------;; ;; basic configuration parameters ;; ;;--------------------------------;; ;; This definition is used to define *theme-path* and is helpful if ;; you specify files to load, as shown immediately below. (define HOME (getenv "HOME")) ;; You can define USER this way ;; (define USER (getenv "USER")) ;; If you are loading both local and system settings, you can do this: ;; (define USERROOT (string-append HOME "/.scwm")) ;; (define SYSTEMROOT "/etc/X11/scwm") ;; ;; (let ((SYSTEMSETTINGS (string-append SYSTEMROOT "/settings")) ;; (USERSETTINGS (string-append USERROOT "/settings"))) ;; (cond ((file-exists? USERSETTINGS) ;; (load USERSETTINGS)) ;; ((file-exists? SYSTEMSETTINGS) ;; (load SYSTEMSETTINGS)) ;; )) ;; However, rather than employ additional files for this `spare-blue' ;; configuration, I have copied my ~/.scwm/settings file into this ;; .scwmrc file, so the above load commands are not needed and are ;; therefore commented out. ;; Also, I do not load any system-wide settings. These actions mean ;; that I have to keep track of only one file, this ~/.scwmrc file ;; (plus the ~/.xsession file for starting X). ;;;;;;;;;;;;;;;; copy of ~/.scwm/settings ;;;;;;;;;;;;;;;; ;; ~/.scwm/settings -*- scwm -*- ;; basic configuration parameters for scwm ;; ATTENTION!!!: THE FOLLOWING VARIABLES MUST BE DEFINED!!! ;; user-image-path, menu-font, title-font, icon-font, ;; focus-type, restart-function, init-function, ;; window-toggle-maximize ;; ==> Note: I have copied this file from the distribution, and customized it. ;;; Specify how to focus on a window ;;; ;; ==> Note: I also specify the mouse focus type in the generic window ;; style; this may be redundant ;; here you can put one of these values: ;; 'click - must click on the window to focus. ;; 'mouse - the window gains focus as the mouse enters or leaves. ;; 'sloppy - the window gains focus as the mouse enters, but does not ;; lose it if the pointer enters the root window, or a window ;; with 'click or 'none focus. ;; 'none - don't ever give this window focus, even if ;; it is clicked. (define focus-type 'mouse) ;; ==> Note: image-load-path also defines where images are located. ;; this defines the path where a user can put own images (define user-image-path '()) ;; ==> Note: Apparently, this two functions serve as `hooks' -- ;; `restart-function' is run before (restart "scwm") ;; and `init-function' is run at the end of this file. ;; Here, these two functions are defined to do nothing. ;; this is the function, scwm calls when you restart it (define (restart-function) '()) ;; init-function is the function, scwm calls after the initialisation. (define (init-function) '()) ;;; now we define the maximize function ;; use this definition, if you want the normal vertical-only maximize function ;; ==> Note that I have defined this to maximize almost, but all the ;; way to the top of the screen. This is because I always like some ;; visible root screen space. (use-scwm-modules animation) (use-modules (app scwm c-animation)) ;; This should make the window appear at the initial position, 1/4 of the ;; way, 1/2 of the way, 3/4 of the way, and finally slide into place. (set-animation! #(0.0 -0.05 -0.1 -0.15 -0.2 -0.25 -0.2 -0.15 -0.1 -0.05 0.0 0.25 0.5 0.75 1.0 1.05 1.1 1.15 1.2 1.25 1.2 1.15 1.1 1.05 1.0)) (define (vertical-toggle-maximize) (toggle-maximize 0 (%y 95))) ;; use this function, if you want a vertical-and-horizontal maximize function ;; (define (window-toggle-maximize) ;; (toggle-maximize (%x 99) (%y 99)) ;; (move-to 7 7)) ;;;;;;;;;;;;;;;; end copy of ~/.scwm/settings ;;;;;;;;;;;;;;;; ;; ------------;; ;; constraints ;; ;; ------------;; (define (enable-constraint-solver) (if (scwm-is-constraint-enabled?) (begin (use-scwm-modules constraints) (start-constraints)) (error "Scwm is not built to support constraints\n\ Get Cassowary from http://www.cs.washington.edu/research/constraints/cassowary/"))) ;; -------;; ;; decors ;; ;; -------;; ;; These decors enable you to change a theme on a per-window basis. ;; Only std-d, lizard-d, and grad-d are defined here. ;; grad-d is the default for this ~/.scwmrc file (define std-d (make-decor "std")) (with-decor std-d (title-style ;; #:font helvetica12 #:justify 'left #:relief 'raised) (border-style #:hidden-handles #f #:no-inset #t)) (define lizard-d (make-decor)) (with-decor lizard-d (title-style ;; #:font helvetica12 #:justify 'left #:relief 'raised) (border-style #:hidden-handles #f #:no-inset #t #:inactive (list #:hidden-handles #f #:no-inset #t))) (define grad-d (make-decor)) (with-decor grad-d (set-rubber-band-mask! 110) (title-style ;; #:font helvetica12 #:font font12 #:justify 'left #:relief 'flat #:h-gradient (list 20 (list "OrangeRed3" 20) "OrangeRed3" "#3cb21c") #:inactive (list #:h-gradient ;; (list 40 (list "grey75" 20) "grey75" "grey25") ;; (list 40 (list "CornflowerBlue" 5) "CornflowerBlue" "navyblue") ;; #0000c3 is decimal 0 0 195 and is between ;; navyblue, 0 0 128, and mediumblue, 0 0 205 (list 40 (list "#0000c3" 50) "#0000c3" "CornflowerBlue") )) (border-style #:no-inset #f #:hidden-handles #f)) (define decor-list (list (cons "Standard" std-d) (cons "Lizard" lizard-d) (cons "Gradient" grad-d))) ;;;; end decors ;;;; ;; --------------------;; ;; locations of images ;; ;; --------------------;; ;;; Set path to use for image searches ;;; On my system, all icons that I use are actually in ;;; /usr/X11R6/include/X11/pixmaps/ (append! image-load-path (list "/usr/X11R6/include/X11/pixmaps" "/usr/X11R6/include/X11/bitmaps" "~/pixmaps" "~/bitmaps" "/usr/share/icons" ;; /usr/share/icons is for wmaker "/usr/local/lib/X11/mini-icons" )) ;; Other possible image directories; none of these are on my system. ;; "/usr/X11/lib/X11/mini-icons" ;; "/usr/share/include/X11/pixmaps" ;; "/usr/share/include/X11/bitmaps" ;; "/usr/lib/icons" ;; "/usr/local/X11/include/X11/pixmaps" ;; "/usr/lib/TheNextLevel/pixmaps" ;; "/usr/local/lib/icons" ;; "/usr/local/icons" ;;----------------------------------;; ;; create miniature icons for menus ;; ;;----------------------------------;; ;; Create the image form used in various menus ;; Not all of these images are used in this ~/.scwmrc file, ;; but are kept because the might be useful in the future. ;; These must be loaded before the window styles, which use them. (define bolt-i (make-image "mini-ray.xpm")) (define bomb-i (make-image "mini-bomb.xpm")) (define bomb-smaller-i (make-image "mini.bomb.xpm")) (define book2-i (make-image "mini-book2.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 debian-i (make-image "Debian-transparent.xpm")) (define decor-i (make-image "mini-exclam.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 eyes-i (make-image "mini-eyes.xpm")) (define fig-i (make-image "mini-paint.xpm")) (define fm-i (make-image "mini-filemgr.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 lock-i (make-image "mini-lock.xpm")) (define lower-i (make-image "mini-lower.xpm")) (define man-i (make-image "mini-manual.xpm")) (define max1-i (make-image "mini-max1.xpm")) (define mini-fractal-i (make-image "mini-fractal.xpm")) ;; (define nscape-i (make-image "mini-netscape.xpm")) (define pdf-i (make-image "mini-pdf.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 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")) ;;(define manx-i (make-image "mini-xman.xpm")) ;; (define decor-i (make-image "mini-color-splotch.xpm")) ;;;; end miniature icons for menus ;;;; ;; -----------------------;; ;; general window styles ;; ;; -----------------------;; ;; Move all windows opaquely and always resize opaquely (set! *opaque-move-percent* 100) (set! *opaque-resize-percent* 100) ;; Enable run-time theme changes (append! *theme-path* (list (string-append (scwm-path-prefix) "/share/scwm/themes") (string-append HOME "/themes"))) ;; Define a style for the clock and other such items (define desk-widget (make-style #:plain-border #t #:sticky #t #:winlist-skip #t #:border-width 3 #:focus 'none)) ;;---------------------------;; ;; specific window styles ;; ;;---------------------------;; ;; I don't like to see icons for my main programs when a window is ;; iconified, only the text with its name, so I commented out those ;; icons. (window-style "xterm" ;; #:icon "/usr/X11R6/lib/X11/twm/images/xterm.xpm" #:mini-icon term-i #:use-decor grad-d) (window-style "emacs" ;; #:icon "gnu-animal.xpm" #:icon-box (list (x- 35) 1 35 (y- 141)) #:use-decor grad-d) ;;(window-style "netscape" ;; ;; #:icon "netscape.xpm" ;; #:placement-proc place-at-point ;; #:use-decor grad-d) (window-style "gimp" ;; #:icon "wilber.xpm" #:mini-icon gimp-i #:use-decor grad-d) (window-style "sketch" ;; #:icon "wilber.xpm" #:mini-icon mini-fractal-i #:use-decor grad-d) (window-style "xclock*" #:no-titlebar #t #:circulate-skip #t #:use-style desk-widget #:fg "yellow" #:bg "red") (window-style "*lock" #:use-style desk-widget) (window-style "xload" #:no-titlebar #t #:use-style desk-widget) (window-style "xscreensaver" #:no-titlebar #t #:use-style desk-widget) (window-style "xbiff" #:no-titlebar #t #:use-style desk-widget) (window-style "xcalc" #:icon "xcalc.xpm") (window-style "xman" #:icon "xman.xpm") (window-style "xmag" #:icon "mag_glass.xpm") ;;--------------------------;; ;; set generic window style ;; ;;--------------------------;; ;; This sets the window style for attributes not mentioned in specific ;; window styles for specific windows. (window-style "*" #:icon #f ;; this turns off icons, but leaves icon titles #:show-icon #t ;; show text of titles for icon, not images ;; #:sticky-icon #t #:auto-raise #t #:auto-raise-delay 0 #:auto-raise-focus-proc raise-window ;; fg is the color used in the text of icon titles, ;; and in the text of inactive images in the pager. #:fg "white" ;; bg is the color used in the background of icon titles, ;; for inactive buttons on a title bar, ;; for inactive images in the pager. #:bg "blue" ;; icon-box: X-position, Y-position, width, height ;; #:icon-box (list (x- 70) 1 69 (y- 141)) #:icon-box (list (x- 35) 1 35 (y- 141)) #:focus 'mouse #:border-width 3 ;; #:placement-proc place-at-point ;; #:transient-placement-proc place-at-point #:mwm-func-hint #t #:mwm-decor-hint #t #:hint-override #t #:decorate-transient #t #:PPosition-hint #f #:lenience #t #:use-decor grad-d) ;;-------;; ;; Pager ;; ;;-------;; ;; This pager is adapted by the scwm developers from that for Fvwm; ;; hence the references to "FvwmPager" (set-desk-size! 2 2) (set-edge-scroll! (%x 100) (%y 100)) ;; delay a move across an edge briefly, and require a small threshhold ;; some people prefer considerably higher values, such as 500 500 (set-edge-resistance! 150 150) (window-style "FvwmPager" #:no-titlebar #t #:use-style desk-widget) (register-fvwm2-module-config "FvwmPager" "*FvwmPagerGeometry -220+4" "*FvwmPagerDeskTopScale 40" "*FvwmPagerHilight NavajoWhite2" ; active window "*FvwmPagerBack burlywood3" ; non-active windows ;; FvwmPagerFore is used for the dashed lines separating ;; workspaces in the pager "*FvwmPagerFore DarkSlateBlue" "*FvwmPagerFont none" "*FvwmPagerSmallFont 5x8" "*FvwmPagerInterPageLineStyle solid" "*FvwmPagerLabel 0 Top" "*FvwmPagerLabel 1 Bottom" ) ;; The following shows two desktops on a double wide pager: ;; (define fvwm2-pager (run-fvwm2-module "FvwmPager" '("0" "1"))) ;; The following shows only the first desktop, not desk two. (define fvwm2-pager (run-fvwm2-module "FvwmPager" '("0" "0"))) ;; ;;;;;;;;;;;;;;;;; Second Pager ;;;;;;;;;;;;;;;; ;; ;; How to create a pager for a second desktop ;; The pager itself appears on both desktops ;; see /usr/local/src/scwmdoc.pdf ;; Create a second FVWM executable: ;; cd /usr/lib/X11/fvwm2; cp -p FvwmPager FvwmPager-2- ;; ;; Evaluate the following: ;; ;; (window-style "FvwmPager-2-" ;; #:no-titlebar #t ;; #:use-style desk-widget) ;; ;; (register-fvwm2-module-config "FvwmPager-2-" ;; "*FvwmPager-2-Geometry -330+4" ; put pager to left of other ;; "*FvwmPager-2-DeskTopScale 40" ;; "*FvwmPager-2-Hilight NavajoWhite2" ; active window ;; "*FvwmPager-2-Back burlywood3" ; non-active windows ;; "*FvwmPager-2-Fore DarkSlateBlue" ;; "*FvwmPager-2-Font none" ;; "*FvwmPager-2-SmallFont 5x8" ;; "*FvwmPager-2-InterPageLineStyle solid" ;; "*FvwmPager-2-Label 0 Top" ;; "*FvwmPager-2-Label 1 Bottom") ;; ;; (define fvwm2-pager-2 (run-fvwm2-module "FvwmPager-2-" '("1" "1"))) ;; ;; ;;;;;;;;;;;;;;;; end second pager ;;;;;;;;;;;;;;;; ;;;; End Pager ;;;; ;;---------------;; ;; define menus ;; ;;---------------;; ;;; menus used by the main root menu ;;; ;; Mouse button bindings are defined in a section below; ;; this section creates the menus. ;; The steps are: ;; 1. create menus used by main root menu (done in this section) ;; 2. create main menu ;; 3. bind the menu to an action such as a mouse click (done below) ;; quit-verify is used by the main root menu (define quit-verify (menu (list (menuitem "Really quit scwm?" #f) ; menu-title (menuitem "Yes" #:action quit) (menuitem "No" #:action #f) menu-separator (menuitem "Restart scwm" #:action (lambda () (restart-function) (restart "scwm")))))) ;; desk-menu is used by the main root menu ;; and is also bound to meta-mouse-3 in the root window (define desk-menu (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)))))) ;;; Debian menus ;;; ;; If you load the file that contains the Debian menus, ;; you can uncomment and use the entries in the main-root-menu below ;; that list the Debian menus. ;; On my system, the Debian menus were generated automatically when I ;; first installed Scwm and were placed in a file called ;; ~/.scwm/scwm_menus ;; You can load the Debian menus file here by uncommenting this command: ;; (load (string-append (getenv "HOME") "/.scwm/scwm_menus")) ;; (Change the name of the file as needed for your system.) ;; The Debian menus list many programs, all of which are part of the ;; Debian GNU/Linux distribution, but not all of which may be ;; installed on your machine. ;; The Debian menus listed below that you may uncomment if you wish are: ;; /Debian/Apps ;; /Debian/Games ;; /Debian/Screen ;; /Debian/System ;; /Debian/WindowManagers ;; /Debian/XShells ;;; main root menu ;;; ;; left button mouse menu on root window (define (popup-main-root-menu) (popup-menu main-root-menu)) (define main-root-menu (menu (list (menuitem "Main Menu" #:image-left "mini-penguin.xpm" ;; #:image-left "jline.xpm" "mini-penguin.xpm" "jline.xpm" #f) menu-separator (menuitem "&80x24 Window" #:image-left "mini.xterm.xpm" #:action (lambda () (execute "xterm -bg darkblue -fg white -cr orchid \ -geometry 80x24+2+130 -name '80x24 xterm' \ -title xterm -e /bin/bash -login"))) (menuitem "&80x74 Window" #:image-left "mini.xterm.xpm" #:action (lambda () (execute "xterm -bg darkblue -fg white -cr orchid \ -geometry 80x74+530+2 -name '80x74 xterm' \ -title xterm -e /bin/bash -login"))) menu-separator (menuitem "&GNU Emacs" #:image-left "mini.emacs.xpm" #:action (lambda () (execute "/usr/bin/emacs20 -fn 7x14 -bg darkblue \ -fg white -geometry 81x62-150+100 -name 'GNU Emacs'"))) ;; (menuitem ;; "&Emacs 21" ;; #:image-left "mini.emacs.xpm" ;; #:action (lambda () ;; (execute "/usr/local/bin/emacs -fn 7x14 -q -l ~bob/.emacs-21 \ ;; -bg darkblue -fg white -geometry 80x63+635+86 \ ;; --icon-type -name 'Emacs 21'"))) menu-separator ;; (menuitem ;; "Netscape 4.7" ;; #:image-left "mini-netscape.xpm" ;; #:action (lambda () ;; (execute "/usr/local/netscape/netscape -no-about-splash \ ;; -no-install -geometry 740x900+350+20"))) ;; ;; (menuitem ;; "Netscape 3.04" ;; #:image-left "mini-netscape.xpm" ;; #:action (lambda () ;; (execute "/usr/local/src/netscape-304/netscape -geometry 740x900+350+20"))) (menuitem "Gzilla" #:image-left "mini-gzilla.xpm" #:action (lambda () (execute "gzilla"))) menu-separator (menuitem "The Gimp" #:image-left "mini-wilbur.xpm" ;; was ;; #:action (lambda () (execute "gimp"))) #:action (lambda () (execute "~/.gimp-script"))) (menuitem "Sketch" #:image-left "mini-fractal.xpm" #:action (lambda () (execute "sketch"))) menu-separator (menuitem "&xcolors" #:image-left "mini.rainbow.xpm" #:action (lambda () (execute "xcolors"))) menu-separator (menuitem "&Constraints" #:submenu (lambda () (ui-constraints-toggle-menu))) (menuitem "Constraint &investigator" #:action (thunk start-constraint-investigator)) (menuitem "Turn &on Constraint Solver" #:action (thunk enable-constraint-solver)) ;;;; Uncomment the following Debian menus ;;;; only if you have loaded the file that contains them. ;;;; See above for how to load that file. ;; menu-separator ;; (menuitem "Debian Menus" #:image-left debian-i) ;; menu-separator ;; (menuitem "&Apps" #:action /Debian/Apps) ;; (menuitem "&Games" #:action /Debian/Games) ;; (menuitem "&Screen" #:action /Debian/Screen) ;; (menuitem "S&ystem" #:action /Debian/System) ;; (menuitem "&WindowManagers" #:action /Debian/WindowManagers) ;; (menuitem "&XShells" #:action /Debian/XShells) menu-separator (menuitem "Desks" #:image-left "/usr/X11R6/lib/tkdesk/images/ficons16/desk.xpm" #:action desk-menu) menu-separator (menuitem "Restart scwm" #:image-left "mini-start.xpm" #:action (lambda () (restart-function) (restart "scwm"))) menu-separator (menuitem "Quit scwm" #:image-left "mini-cross.xpm" #:action quit-verify)))) ;;; end main root menu ;;; ;;; middle mouse root menu ;;; ;; need this to run scwmrepl (define (run-scwm-in-xterm) (execute "xterm -e scwmrepl")) ;; menu-for-preferences is used by the middle mouse root menu (define menu-for-preferences (menu (list (menu-title "Preferences" #f) menu-separator (menuitem "Scwm &Options...." #:action (lambda () (scwm-options-dialog))) (menuitem "Change background color..." #:action (lambda () (prompt-color "New background color" (lambda (c) (set-background-color! c)) #:title "Background color?"))) ;; global themes are in ;; /usr/local/share/scwm/themes ;; as tar.gz files that Scwm reads automagically (menuitem "Change global theme" #:submenu (lambda () (menu-global-theme #t))) (menuitem "Scwm interaction" #:action run-scwm-in-xterm) (menuitem "Info on a window" #:action window-info)))) ;; middle mouse button on root window (define (popup-ops) (popup-menu window-ops-menu)) ;; middle mouse button on root window; bound to popup-ops (define window-ops-menu (menu (list (menu-title "Window Ops" #f) menu-separator (menuitem "Move" #:action interactive-move) (menuitem "Resize" #:action interactive-resize) (menuitem "Raise" #:action raise-window) (menuitem "Lower" #:action lower-window) ;; (menuitem "Print" #:action print-window) (menuitem "(Un)Window-Shade" #:action toggle-window-shade) (menuitem "(De)Iconify" #:action toggle-iconify) (menuitem "(Un)Maximize" #:action vertical-toggle-maximize) (menuitem "(Un)Stick" #:action toggle-stick) (menuitem "(Un)Keep On Top" #:action toggle-on-top) menu-separator (menuitem "&Preferences" #:image-left "mini-prefs.xpm" #:action 'menu-for-preferences) menu-separator (menuitem "Close" #:action close-window) (menuitem "Delete" #:action delete-window) (menuitem "Destroy" #:action destroy-window) menu-separator (menuitem "Restart scwm" #:action (lambda () (restart-function) (restart "scwm"))) menu-separator (menuitem "Refresh Screen" #:action refresh)))) ;;; end middle mouse root menu ;;; ;;; titlebar mouse menu ;;; ;; bindings for mouse buttons on the title bar ;; are created in a section below ;; leftmost button on title bar (define (popup-small-ops) (popup-menu (make-small-window-ops-menu (get-window)))) ;; leftmost button on title bar (define (make-small-window-ops-menu ww) (menu (list (menu-title "Small Ops" #:image-left windows-i) menu-separator (menuitem "Re&size" #:image-left resize-i #:action interactive-resize) menu-separator (menuitem "Info" #:image-left quest-i #:action window-info) (menuitem "More" #:action (menu (list (menuitem "&Raise" #:action raise-window) (menuitem "&Lower" #:action lower-window) ;; (menuitem (if (sticky? ww) "Un&stick" "&Stick") ;; #:action toggle-stick) ;; (menuitem (if (window-shaded? 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 #:action close-window) (menuitem "&Delete" #:image-left bomb-smaller-i #:action delete-window) (menuitem "&Destroy" #:image-left bomb-i #:action destroy-window)))) ;; ---------------------------;; ;; how title bar buttons look ;; ;; ---------------------------;; (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 iconify-face ;; (make-face '((relief raised)) '((pixmap "mini.iconify.xpm"))) ;; (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 stylized-X-face ; Stylized X for closing window (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 up-down-arrow-face ; Vertical Line with arrowheads on (make-face '((relief raised)) ; top and bottom for toggling vert-maximize '((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)))))) ;; ----------------------------------------;; ;; how to bind a mouse button to an action ;; ;; ----------------------------------------;; ;; As of 1999 Sep 28, title bar buttons are numbered in two different ;; ways, depending on which functions are called. ;; The old way, now deprecated, referred to button-1, button-2, ;; button-3, and so on. The sequence on the title bar went like this: ;; left side right side ;; 1 3 5 6 4 2 ;; This sequence is used by `set-button-face!' to determine which ;; button location receives which face ;; However, titlebar buttons are now labeled `left-button-1', ;; `left-button-2', `right-button-2',`right-button-1', and so on. ;; The sequence on the title bar goes like this: ;; left side right side ;; left-button-1 left-button-2 right-button-2 right-button-1 ;; This sequence is used by `bind-mouse' to determine which button ;; location carries out which action when pressed. ;; The `set-button-face!' function takes the arguments: ;; ;; BUTTON-NUMBER ACTION ;; ;; where the BUTTON-NUMBER is 1, 3, 5 for the left side and 6, 4, 2 ;; for the right side of the titlebar. ;; In a titlebar, the `bind-mouse' function takes the arguments: ;; ;; TITLE-BAR-BUTTON-NAME MOUSE-BUTTON PROCEDURE-INVOKED ;; ;; where TITLE-BAR-BUTTON-NAME is a string giving the mouse button number ;; MOUSE-BUTTON is the left, middle, or right mouse button, ;; numbered 1, 2, 3 ;; ;; More generally speaking, TITLE-BAR-BUTTON-NAME is CONTEXTS ;; and is a list of event-contexts (e.g., '(left-button-1 frame-sides)) ;; ;; The contexts include: ;; 'window ;; 'title ;; 'icon ;; 'root ;; 'frame-corners ;; 'frame-sides ;; 'client-window ;; 'root-window ;; 'left-button-N (N=1-5) ;; 'right-button-N (N=1-5) ;; -----------------------------;; ;; set button faces on titlebar ;; ;; -----------------------------;; ;; This adds the button faces to the titlebar, in all decors. ;; left-most button, the action of which is a menu (map (lambda (decor) (with-decor (cdr decor) (set-button-face! 1 prog-face ))) decor-list) ;; second to left-most button, the action of which is to toggle size (map (lambda (decor) (with-decor (cdr decor) (set-button-face! 3 up-down-arrow-face))) decor-list) ;; second to right-most button, the action of which is to iconify (map (lambda (decor) (with-decor (cdr decor) (set-button-face! 4 iconify-face))) decor-list) ;; right-most button, the action of which to delete the window (map (lambda (decor) (with-decor (cdr decor) (set-button-face! 2 stylized-X-face))) decor-list) ;; -------------------------------;; ;; titlebar button mouse bindings ;; ;; -------------------------------;; ;; context: left-most titlebar button ;; mouse button: number one, which is left mouse button ;; procedure invoked: popup-small-ops (bind-mouse 'left-button-1 1 popup-small-ops) ;; context: second to left-most titlebar button ;; mouse button: number one, which is left mouse button ;; procedure invoked: vertical-toggle-maximize (bind-mouse 'left-button-2 1 vertical-toggle-maximize) ;; context: second to right-most titlebar button ;; mouse button: number one, which is left mouse button ;; procedure invoked: iconify (bind-mouse 'right-button-2 1 animated-iconify) ;; context: right-most titlebar button ;; mouse button: number one, which is left mouse button ;; procedure invoked: delete-window (bind-mouse 'right-button-1 1 delete-window) ;;;; end titlebar button mouse bindings ;;;; ;; -------------------------------------;; ;; Mouse button bindings in root window ;; ;; -------------------------------------;; ;;; root menus ;;; ;; context: root window ;; mouse button: number one, which is left mouse button ;; procedure invoked: popup-main-root-menu (bind-mouse 'root 1 popup-main-root-menu) ;; context: root window ;; mouse button: number two, which is middle mouse button ;; procedure invoked: popup-ops (bind-mouse 'root 2 popup-ops) ;; context: root window ;; mouse button: number three, which is right mouse button ;; procedure invoked: show-window-list-menu (bind-mouse 'root 3 (lambda () (show-window-list-menu #t #:by-resource #t #:show-last-focus-time #t #:show-geometry #t))) ;; context: root window ;; mouse button: Meta (e.g., ALT) key and right mouse button, together ;; procedure invoked: popup-menu (bind-mouse 'root "M-3" (lambda () (popup-menu desk-menu))) ;;;; end mouse button bindings in root window ;;;; ;; ------------------------------------------------------;; ;; Mouse button bindings in corners and sides of windows ;; ;; ------------------------------------------------------;; ;; context: window corners ;; mouse button: number one, which is left mouse button ;; procedure invoked: resize-or-raise (bind-mouse 'frame-corners 1 resize-or-raise) (bind-mouse 'frame-corners 2 popup-small-ops) (bind-mouse 'frame-sides 1 resize-or-raise) (bind-mouse 'frame-sides 2 move-or-raise) ;;;; Example: how to bind mouse button in two contexts ;; context: window corners and window sides ;; mouse button: number two, which is middle mouse button ;; procedure invoked: popup-small-ops ;; (bind-mouse '(frame-corners frame-sides) 2 popup-small-ops) ;; context: titlebar (not a button) ;; mouse button: number two, which is middle mouse button ;; procedure invoked: toggle-raise (bind-mouse 'title 2 toggle-raise) ;;; Bind mouse button to one action for single click, ;;; second action for double click ;; First define the action using double-click as one mouse-event-type (define (move-or-shade) (case (mouse-event-type) ((double-click) (toggle-window-shade)) (else (move-or-raise)))) ;; context: titlebar (not a button) ;; mouse button: number one, which is left mouse button ;; procedure invoked: move-or-shade (bind-mouse 'title 1 move-or-shade) ;;;; end mouse button bindings in corners and sides of windows ;;;; ;; ---------------------------------------;; ;; Mouse button bindings inside of window ;; ;; ---------------------------------------;; ;; Meta-Mouse-3 anywhere in window moves or shades it ;; context: anyhwere in a window ;; mouse button: number three, which is right mouse button ;; procedure invoked: move-or-shade (bind-mouse 'window "M-3" move-or-shade) ;; Meta-Mouse-2 closes a window ;; either by deleting (friendly) or destroying it. ;; context: window ;; mouse button: Meta (e.g., ALT) key and middle mouse button, together ;; procedure invoked: close-window (bind-mouse 'window "M-2" close-window) ;;;; end mouse button bindings inside of window ;;;; ;;---------------------------------;; ;; Mouse button bindings for icons ;; ;;---------------------------------;; ;; Either deiconify or move an icon (define (move-or-deiconify) (case (mouse-event-type) ((motion) (interactive-move)) ((double-click) (deiconify)))) ;; /usr/local/share/scwm/modules/app/scwm/ ;; /u/scwm/scheme (bind-mouse 'icon 1 deiconify-window) (bind-mouse 'icon 2 move-or-deiconify) ;;;; end mouse button bindings for icons ;;;; ;; (use-modules ;; (app scwm fvwm-compat) (app scwm fvwm-eval) (app scwm fvwm-module)) ;;--------------------------------;; ;; key binding for window context ;; ;;--------------------------------;; ;; I find I use this key binding all the time! (bind-key 'window "M-z" animated-iconify) ;;;; end key binding for window context ;;;; ;;----------------------------------;; ;; key binding to move the viewport ;; ;;----------------------------------;; (bind-key 'all "C-Left" (lambda () (move-viewport (%x -100) 0))) (bind-key 'all "C-Right" (lambda () (move-viewport (%x 100) 0))) (bind-key 'all "C-Up" (lambda () (move-viewport 0 (%y -100)))) (bind-key 'all "C-Down" (lambda () (move-viewport 0 (%y 100)))) ;; Also, you can rotate among the current window using a keyboard command. ;; I don't use these because I usually have too many windows for this ;; to be efficient. ;; (bind-key 'all "M-Tab" ;; (lambda () (next-window #:only visible? #:except iconified?))) ;; ;; (bind-key 'all "M-S-Tab" ;; (lambda () (prev-window #:only visible? #:except iconified?))) ;;;; end key binding to move the viewport ;;;; ;;---------------------------;; ;; key binding for emergency ;; ;;---------------------------;; ;; This binding came as part of the distribution. ;; This works in all contexts ;; in case of emergency, hit Control-Meta-Shift-Q (bind-key 'all "C-M-S-q" quit) ;;;; Normally, you quit your X Windows session by closing applications ;;;; and then pressing Meta-Ctrl-Backspace (you may use your Alt key for Meta) ;;;; or by using the mouse to `Quit scwm". ;;;; end key bindings for emergency ;;;; ;;--------------------------------------;; ;; Preferences from scwm-options-dialog ;; ;;--------------------------------------;; (load-preferences) ;;----------------------------------;; ;; init-function: last item in file ;; ;;----------------------------------;; ;; this function appears to me to server as a hook; it was defined ;; earlier in this file (init-function) ;; (make-message-window "Starting SCWM ... done ") ;;;;;;;;;;;;;;;; end of ~/spare-blue.scwmrc file ;;;;;;;;;;;;;;;;