##########################################################################
# FVWM - F? Virtual Window Manager, Version 2.x (fvwm2) Configuration File

# Last Modified:  Fri Sep  6 10:43:21 CDT 2002
# mein@cs.umn.edu

############################################################################
# COLORS and FONTS
#
# Set the fore and back border colors for the window that has focus
HilightColor		black/magenta4

# Set fore/back border colors for all other windows 
Style "*" Color black/maroon4

# Set colors/font for pop-up menus
# Syntax: MenuStyle forecolor backcolor shadecolor font style(fvwm/mwm)
MenuStyle black maroon4 black fixed fvwm

# Set fonts to use on title bar and icon label
WindowFont	fixed
IconFont	fixed

############################################################################
# ICON Setup
#
# Auto Place Icons is a nice feature (Left Top Right Bottom)
Style "*" IconBox 1 -50 -100 -1

# If you want ALL icons to follow you around the desktop (Sticky)
#Style "*" StickyIcon

############################################################################
# FOCUS Setup
#
# Does the window with focus control the colormap, or the one under the mouse
# ColormapFocus FollowsFocus
# ColormapFocus FollowsMouse

# Uncomment this to force you to click in a window to give it focus
#Style "*" ClickToFocus

# default: focus follows mouse
Style "*" MouseFocus

# If you knock your mouse out of the xterm, it keeps focus while in root window
Style "*term"		SloppyFocus

############################################################################
# MISC Setup
#
# click/release must occur in <n milliseconds to be a "click"
ClickTime 250

# if the window occupies less than n% of the screen, draw it opaque
OpaqueMoveSize 100

# turn off paging
EdgeScroll 0 0
EdgeResistance 0 0

# MWM Emulation: Don't ignore hints for functions and transient decoration
Style "*" MWMFunctions, MWMDecor
Style "*" HintOverride
Style "*" MWMBorder

# Changes the look of the "rubberband" you see when moving windows (0 - 255)
#XORvalue 100

###########################################################################
# PAGER Setup
#
# set the desk top size in units of physical screen size (width x height)
DeskTopSize 2 2

############################################################################
# WINDOW Placement
#
# SmartPlacement makes new windows pop-up in blank regions of screen 
Style "*" SmartPlacement

############################################################################
# STYLE Flag Setup
#
# (decorations and window options) 
# Note: Order is important!! If compatible styles are set, styles are ORed
# together. If conflicting styles are set, the last one specified is used.

# change the default width, set a global icon, and give borders to popups
Style "*" BorderWidth 7, HandleWidth 7, Icon x.xpm, DecorateTransient

Style "Fvwm*"		NoTitle, Sticky, WindowListSkip, Borderwidth 0, HandleWidth 0
Style "FvwmPager"	NoTitle, Sticky, WindowListSkip, Borderwidth 0, HandleWidth 0
Style "*lock"		NoTitle, Sticky, WindowListSkip, BorderWidth 0, HandleWidth 0
Style "xbiff"		NoTitle, Sticky, WindowListSkip, BorderWidth 0, HandleWidth 0
Style "xload"		NoTitle, Sticky, WindowListSkip, ClickToFocus
Style "xsession"	NoTitle, Sticky, WindowListSkip, ClickToFocus
Style "xconsole"	NoTitle, Sticky, WindowListSkip, ClickToFocus, BorderWidth 0, HandleWidth 0
Style "xfsm"		NoTitle, Sticky, WindowListSkip, ClickToFocus
Style "xdaliclock"	NoTitle, Sticky, WindowListSkip, ClickToFocus
Style "FvwmButtons"	ClickToFocus, BorderWidth 5, HandleWidth 0
Style "FvwmIdent"	BorderWidth 0, HandleWidth 0
Style "Time 3D"		NoTitle, Sticky
Style "*term"		Icon xterm.xpm
Style "xcalc"		Icon xcalc.xpm
Style "xbiff"		Icon mail1.xpm
Style "xman"		Icon xman.xpm
Style "emacs"		NoPPosition
Style "Mosaic"		NoPPosition
Style "xmh"		Icon mail2.xpm StartsOnDesk 2

#############################################################################
# START-UP Functions
#
AddToFunc "InitFunction" "I" Exec exec xv -max -root -quit /opt/local/share/WindowMaker/Backgrounds/UofM.jpg
+              "I" Module FvwmButtons

AddToFunc "RestartFunction" "I" Module FvwmButtons

##############################################################################
# MENU Setup
#

# This defines the most common window operations
AddToMenu Window-Ops    "Window Ops"    Title
+                       "Move"          Move-or-Raise2
+                       "Resize"        Resize-or-Raise2
+                       "Raise"         Raise
+                       "Lower"         Lower
+                       "(De)Iconify"   Iconify
+                       "(Un)Stick"     Stick
+                       "(Un)Maximize"  maximize_func
+                       ""              Nop
+                       "Delete"        Delete
+                       "Close"         Close
+                       "Destroy"       Destroy
+                       ""              Nop
+                       "Refresh Screen" Refresh

# A trimmed down version of "Window Ops", good for binding to decorations
AddToMenu Window-Ops2   "Move"          Move-or-Raise
+                       "Resize"        Resize-or-Raise
+                       "Raise/Lower"   RaiseLower
+                       "Iconify"       Iconify
+                       "(Un)Stick"     Stick
+                       ""              Nop
+                       "Delete"        Delete
+                       "Close"         Close
+                       "Destroy"       Destroy

# This is the root menu
AddToMenu RootMenu " -- fvwm -- "  Title
+		"Xterm"		Exec exec xterm -sb &
+		"Rxvt"		Exec exec rxvt &
+		"Xlock"		Exec exec xlock &
+		"" 		Nop
+		"Applications"	Popup AppMenu
+		"Editors" 	Popup EditorsMenu
+		"Email"		Popup EmailMenu
+		"Utilities"	Popup UtilsMenu
+		"Config"	Exec exec xterm -g 132x24 -T "FVWM Config" +sb -e pico ${HOME}/.fvwm2rc &
+		"Refresh" 	Refresh
+               "Restart"	Restart fvwm2
+		"Start WindowMaker" Restart wmaker
+ 		"Exit Fvwm"     Quit

AddToMenu EmailMenu " Email "  Title
+		"Pine"		Exec exec xterm -e pine &
+		"Mutt"  	Exec exec xterm -e mutt &
+		"Elm"   	Exec exec xterm -e elm &

AddToMenu EditorsMenu " Editors " Title
+		"Pico"		Exec exec xterm -e pico &
+		"Vi"		Exec exec xterm -e vi &
+		"Gvim"		Exec exec gvim &
+		"Emacs"		Exec exec emacs &
+		"XEmacs"	Exec exec xemacs &
+		"XEdit"		Exec exec xedit &

AddToMenu AppMenu " Applications " Title 
+		"Mozilla"	Exec exec mozilla &
+		"Ghostview"	Exec exec gv &
+		"Acroread"	Exec exec acroread &
+		"Graphics"	Popup GraphicsMenu
+		"StarOffice"	Exec exec soffice &

AddToMenu GraphicsMenu " Graphics " Title
+		"Gimp"		Exec exec gimp &
+		"XV"		Exec exec xv &
+		"XFig"		Exec exec xfig &

AddToMenu UtilsMenu	" Utilities " Title
+		"Caculator"	Exec exec xcalc &
+		"Window Properties"	Exec exec xprop | xmessage -center -title 'xprop' -file - &
+		"Font Chooser"	Exec exec xfontsel &
+		"Magnify"	Exec exec xmag &
+		"Colormap"	Exec exec xcmap &
+		"Clipboard"	Exec exec xclipboard &

############################################################################
# COMPLEX FUNCTIONS
#
AddToFunc warp-or-run		"I" Next [$0 CirculateHit] Iconify -1
+				"I" Next [$0 CirculateHit] Focus
+				"I" None [$0] $1

AddToFunc MailFunction		"I" Next [$0] Iconify -1
+				"I" Next [$0] focus
+				"I" None [$0] Exec $0 $1

AddToFunc Move-or-Raise		"I" Raise
+				"M" Move
+				"D" Lower

AddToFunc Move-or-Raise2        "M" Raise
+				"M" Move
+				"D" Lower

AddToFunc Maximize-Func         "C" Maximize     0 100
+                               "D" Maximize     100 100

AddToFunc Move-or-Iconify       "I" Raise
+                               "M" Move
+                               "D" Iconify

AddToFunc Resize-or-Raise       "I" Raise
+                               "M" Resize
+                               "D" Lower

AddToFunc Resize-or-Raise2      "M" Raise
+                               "M" Resize
+                               "D" Lower

AddToFunc PrintFunction         "I" Raise
+                               "I" Exec xdpr -id $w

AddToFunc Iconify-and-Raise     "I" Iconify
+                               "I" Raise

############################################################################
# MOUSE Setup
#
# First, the root window. Button 1 brings up the Main Menu. B2 is the
# window operations list, and B3 is the winlist module
#     Button	Context Modifi 	Function
Mouse 1		R   	A       Menu RootMenu Nop
Mouse 2		R    	A       Menu Window-Ops Nop
Mouse 3		R    	A      	WindowList

# Now, title bar buttons
# Left button is the Window-Ops2 menu, right is iconify, rightmost is maximize
#     Button	Context Modifi 	Function
Mouse 0		1       A       Menu Window-Ops2 Close
Mouse 0		2    	A     	Maximize-Func
Mouse 0		4    	A     	Iconify
Mouse 0		3       A       Stick

# Button 1 in Frame or Sides is a resize-or-raise, in Icons is a move or 
# de-iconify, and on Top does a move-or-raise
#     Button	Context Modifi 	Function
Mouse 1 	FS      A       Resize-or-Raise
Mouse 1		I       A       Move-or-Iconify
Mouse 1		T       A       Move-or-Raise

# Button 2 in an Icon is de-iconify, in Corners/Sides/Titlebar gets Ops Menu
#     Button	Context Modifi 	Function
Mouse 2 	I       A       Iconify
Mouse 2 	FST     A       Menu Window-Ops2 Nop

# Button 3 does a raise-lower on anything
Mouse 3 	TSIF    A       RaiseLower

############################################################################
# KEYBOARD Setup
#
# press arrow + control anywhere, and scroll by 1 page
Key Left	A	C	Scroll -100 +0
Key Right	A	C	Scroll +100 +0
Key Up		A	C	Scroll +0   -100
Key Down	A	C	Scroll +0   +100

# press arrow + meta key, and scroll by 1/10 of a page
Key Left	A	M	Scroll -10   +0
Key Right	A	M	Scroll +10   +0
Key Up		A	M	Scroll  +0  -10
Key Down	A	M	Scroll  +0  +10

# press shift arrow + control anywhere, and move the pointer by 1% of a page
Key Left	A	SC	CursorMove -1  +0
Key Right	A	SC	CursorMove +1  +0
Key Up		A	SC	CursorMove +0  -1
Key Down	A	SC	CursorMove +0  +1

# press shift arrow + meta key, and move the pointer by 1/10 of a page
Key Left	A	SM	CursorMove -10  +0
Key Right	A	SM	CursorMove +10  +0
Key Up		A	SM	CursorMove +0  -10
Key Down	A	SM	CursorMove +0  +10

# Keyboard accelerators
Key F1		A	MC	Popup "RootMenu"
Key F2		A	MC	Popup "Window-Ops"
Key F3		A	MC	Module FvwmWinList 
Key F4		A	MC	Iconify
Key F5		A	MC	Move
Key F6		A	MC	Resize
Key F7		A	MC	Next [*] focus
Key F8		A	MC	Prev [*] focus

############################################################################
# FvwmButtons
#
# Colors
*FvwmButtonsFore black
*FvwmButtonsBack maroon4

ButtonStyle 2 4 50x35@1 65x65@0 35x65@0 50x35@1
ButtonStyle 4 4 50x65@1 35x35@1 65x35@1 50x65@0

# Font 
*FvwmButtonsFont	fixed

# Geometry-- really likes to pick its own size, but giving a position is OK
*FvwmButtonsGeometry 360x120-1-1

# Define the buttons to use.....
*FvwmButtons(6x1) - - Swallow "FvwmPager" 'FvwmPager 0 2'
*FvwmButtons(2x1) - - Swallow "wmCalClock" 'Exec wmCalClock -24'
*FvwmButtons Xterm		xterm.xpm	Exec "xterm" xterm -sb -n ${HOST} &
*FvwmButtons Mozilla		netscape.xpm	Exec "Mozilla" mozilla &
*FvwmButtons Logout!		whatever	Quit

############################################################################
# FvwmIdent
#
# Give us colors and a fonts
*FvwmIdentBack MidnightBlue
*FvwmIdentFore Yellow
*FvwmIdentFont fixed

##########################################################################t
#
# FvwmPager
#
*FvwmPagerBack maroon3
*FvwmPagerFore black
*FvwmPagerHilight maroon4
*FvwmPagerFont fixed
*FvwmPagerLabel 0 Virtual Desktop

############################################################################
# FvwmWinList
#
*FvwmWinListBack #908090
*FvwmWinListFore Black
*FvwmWinListFont fixed
*FvwmWinListAction Click1 Iconify -1,Focus
*FvwmWinListAction Click2 Iconify
*FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent
*FvwmWinListUseSkipList

############################################################################
# FvwmBacker
#
*FvwmBackerDesk 0 -solid steelblue
*FvwmBackerDesk 1 -solid midnightblue

############################################################################
# FvwmIconBox
#
# NOTE: Icons will only be shown in module if Style "??" NoIcon is set
*FvwmIconBoxIconBack    #cfcfcf
*FvwmIconBoxIconHiFore  black
*FvwmIconBoxIconHiBack  LightSkyBlue
*FvwmIconBoxBack        #5f9ea0
*FvwmIconBoxGeometry    5x1+0+0
*FvwmIconBoxMaxIconSize 64x38
*FvwmIconBoxFont        -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
*FvwmIconBoxSortIcons   IconName
*FvwmIconBoxPadding     4
*FvwmIconBoxLines       10
*FvwmIconBoxSBWidth     11
*FvwmIconBoxPlacement   Left Top
*FvwmIconBoxPixmap      fvwm.xpm
*FvwmIconBoxSetWMIconSize
*FvwmIconBoxHilightFocusWin
*FvwmIconBoxMouse       1       Click           RaiseLower
*FvwmIconBoxMouse       1       DoubleClick     Iconify
*FvwmIconBoxMouse       2       Click           Iconify -1, Focus
*FvwmIconBoxMouse       3       Click           Module FvwmIdent
*FvwmIconBoxKey         r       RaiseLower
*FvwmIconBoxKey         space   Iconify
*FvwmIconBoxKey         d       Close
*FvwmIconBoxKey         n       Next
*FvwmIconBoxKey         p       Prev
*FvwmIconBoxKey         h       Left
*FvwmIconBoxKey         j       Down
*FvwmIconBoxKey         k       Up
*FvwmIconBoxKey         l       Right
