#############################################################################
#
# Here's nation@rocket.sanders.lockheed.com's MWM like configuration,
# with several chnages to make it more 4Dwm like by
# tabaer@magnus.acs.ohio-state.edu. Perhaps some mwm fans can
# fix this up a little, and mail the changes to me:
#
###########################################################################
# set up the colors
#
# this is used for non-selected windows, menus, and the panner
#StdForeColor 		#E5DEA3
#StdBackColor 	        #708090

StdBackColor 		#BA949A468193
StdForeColor 	        #000000

# this is used for the selected window
#HiForeColor 		White
#HiBackColor 		#5F9EA0

HiForeColor 		Black
HiBackColor 		#9851785167AD

# Menu colors
MenuForeColor           Black
MenuBackColor           grey
MenuStippleColor        SlateGrey


OpaqueMove 10



############################################################################
# Now the fonts - one for menus/icons, another for window titles
Font			10x20
WindowFont		-*-times-*-r-*-*-18-*
IconFont                -*-helvetica-bold-o-*-*-14-*-100-100-*-*-*-*
###########################################################################
# Set up the major operating modes
#
# Set windows to auto-raise after 750 milliseconds
# AutoRaise 750

# Normally, we'll be in focus-follows mouse mode, but uncomment this 
# for mwm-style click-to-focus
ClickToFocus

# Auto Place Icons is a nice feature....
# This creates two icon boxes, one on the left side, then one on the
# bottom. Leaves room in the upper left for my clock and xbiff,
# room on the bottom for the Pager.

#Lenience
IconBox -80 0 -5 -140
IconBox 5 -140 -140 -5


# If you uncomment this, and make sure that the WindowList is bound to
# something, it works pretty much like an icon manager.
#SuppressIcons

# If you don't like the default 150 msec click delay for the complex functions
# change this and uncomment it.
ClickTime 150

#MWM Emulation stuff:
MWMFunctionHints
MWMDecorHints
MWMBorders
MWMMenus
MWMButtons

##########################################################################
#Set up cursors
Cursor 3 132
Cursor 6 132
Cursor 7 132


#ButtonStyle 1 50x22
#ButtonStyle 2 50x50
#
#ButtonStyle 4 22x22
#ButtonStyle : 3 20 30x30@0 35x30@0 50x45@0 65x30@0 70x30@0 70x35@0 55x50@0 70x65@0 65x70@0 50x55@0 35x70@0 30x70@0 30x65@0 45x50@0 30x35@0 30x30@0 70x70@0 50x50@0 30x70@0 70x30@0 
#ButtonStyle : 3 13 26x29@1 34x21@1 50x35@1 70x21@1 79x29@1 63x48@0 79x65@1 70x75@0 50x61@0 34x75@0 26x65@0 44x48@1 26x29@0

ButtonStyle 1 50x22
ButtonStyle : 2 13 26x29@1 34x21@1 50x35@1 70x21@1 79x29@1 63x48@0 79x65@1 70x75@0 50x61@0 34x75@0 26x65@0 44x48@1 26x29@0
#ButtonStyle : 2 13 26x29@0 34x21@0 50x35@0 70x21@0 79x29@0 63x48@0 79x65@0 70x75@0 50x61@0 34x75@0 26x65@0 44x48@0 26x29@0
ButtonStyle 4 50x50
#
ButtonStyle 6 22x22
#ButtonStyle : 3 20 30x30@0 35x30@0 50x45@0 65x30@0 70x30@0 70x35@0 55x50@0 70x65@0 65x70@0 50x55@0 35x70@0 30x70@0 30x65@0 45x50@0 30x35@0 30x30@0 70x70@0 50x50@0 30x70@0 70x30@0 


###########################################################################
# Set up the virtual desktop and pager

#set the desk top size in units of physical screen size
DeskTopSize 3x2

# and the reduction scale used for the panner/pager
DeskTopScale 14


# flip by whole pages on the edge of the screen.
EdgeScroll 0 0

RandomPlacement

DecorateTransients     


##########################################################################
# Module path and paths to the icons
#
# ModulePath is a colon-separated list, just like regular unix PATH

ModulePath /usr/lib/X11/fvwm
PixmapPath /usr/include/X11/pixmaps:/usr/include/X11/bitmaps
IconPath   /usr/include/X11/pixmaps:/usr/include/X11/bitmaps

#############################################################################
# Stuff to do at start-up
Function "InitFunction"
#        Module  "I"     GoodStuff
	Exec	"I"      sleep 3;rxvt -T xterm -geometry +100+100&
#        Module  "I"     FvwmFileMgr
        Module  "I"     FvwmPager 0
EndFunction
Function "RestartFunction"
#        Module  "I"     GoodStuff
#        Module  "I"     FvwmFileMgr
         Module  "I"     FvwmPager 0
EndFunction

############################################################################
# Set the decoration styles and window options
# Order is important!!!!
# If compatible styles are set for a single window in multiple Style
# commands, then the styles are ORed together. If conflicting styles
# are set, the last one specified is used.


# change the default width.
Style "*" BorderWidth 5, HandleWidth 5, Icon default.xbm

Style "Fvwm*"       Sticky, WindowListSkip,BorderWidth 5
Style "*Pager" NoTitle, NoHandles, Sticky, WindowListSkip
#Style "FvwmBanner" StaysOnTop
Style "GoodStuff"   NoTitle, Sticky, WindowListSkip,NoHandles, BorderWidth 1
Style "*lock"       NoTitle, NoHandles, Sticky, WindowListSkip
Style "xbiff"       NoTitle,            Sticky, WindowListSkip
Style "Console"     Icon term.xpm
Style "xterm"       Icon Xterm.xpm
Style "rxvt"        Icon Xterm.xpm
Style "Appointment" Icon datebook.xpm
Style "xcalc"       Icon xcalc.xpm
Style "xbiff"       Icon mail2.xpm
Style "xman"        Icon xman.xpm
Style "xvgr"        Icon graphs.xpm
Style "matlab"      Icon math4.xpm
Style "xmag"        Icon mag_glass.xpm
Style "mail"        Icon mail1.xpm
Style "emacs*"      Icon edit.xpm
Style "XMixer"      Icon speaker.xpm
Style "xmixer"      Icon speaker.xpm
Style "Minicom"     Icon phone1.xpm


#############################################################################
#now define the menus - defer bindings until later

# This menu is invoked as a sub-menu - it allows you to quit,
# restart, or switch to another WM.
Popup "Quit-Verify"
	Title	"Really Quit Fvwm?"
	Nop	"This may log you out!"
	Nop	""
	Quit	"Yes, Really Quit"
	Restart "Restart fvwm" fvwm
	Nop	""
	Nop	"No, Don't Quit"
EndPopup

# This menu checks to make sure you REALLY want to log out,
# assuming killing the WM will kick you out of X.
PopUp	"Logout-Verify"
	Title	" Do You REALLY want to log out? "
	Nop	""
	Quit	" Yes, log me out. "
	Nop	" No, cancel that. "
EndPopUp

# Menu of silly things every X setup should have
Popup "Shells"
	Title 	"Shells" 
	Exec	"Xterm (7x14 font)"	exec /usr/bin/X11/xterm -sb -sl 500 -j -ls -fn 7x14 &
	Exec	"Large Xterm (10x20 font)"	exec /usr/bin/X11/xterm -sb -sl 500 -j -ls -fn 10x20 &
	Exec	"Large Rxvt (10x20 font)"	exec /usr/bin/X11/rxvt -font 10x20 -fb 10x20 -ls &
	Exec	"Large Color Xterm (10x20 font)"	exec /usr/bin/X11/color_xterm -sb -sl 500 -j -ls -fn 10x20 &
EndPopup

# A set of NASTY time killers...
PopUp "Games"
	Title	"Games"
	Nop	""
	Exec	"Tetris"	exec xtetris &
	Exec	"Lander"	exec xlander &
	Exec	"Xvier"		exec xvier &
	Exec	"Doubledeck Solitaire"	exec spider &
	Exec	"Puzzles"	exec xpuzzle &
	Exec	"Make 5"	exec xmake5 &
EndPopUp

# All sorts of different time pieces
PopUp "Clocks"
	Title	"Clocks"
	Nop	""
	Exec	"Analog Clock"	exec xclock -analog &
	Exec	"Digital Clock"	exec xclock -digital &
	Exec	"Round Clock"	exec oclock &
EndPopUp

PopUp "SysMonitor"
	Title	"System Monitors"
	Nop	""
	Exec	"System Load"	exec xload &
	Exec	"Memory Usage"	exec xmem &
#	Exec	"Console Messages"	exec xconsole &
EndPopUp

# A menu of various and sundry background graphics on my machine.
# Note that some of them are on a mounted DOS partition...
# The xv invokations don't work as well as I'd like, but I can't find
# a man page for it on my system. --tabaer@magnus
PopUp "Pixmaps"
	Title	"Wallpaper"
	Nop	""
	Exec	"MIT Logo"	exec xsetroot -bg White -fg LightSkyBlue -bitmap /usr/include/X11/bitmaps/mensetmanus &
	Exec	"X Logo"	exec xsetroot -bg White -fg Black -bitmap /usr/include/X11/bitmaps/xlogo64 &
	Exec	"Escher Knots"	exec xsetroot -bg LightSkyBlue -fg Black -bitmap /usr/include/X11/bitmaps/escherknot &
	Exec	"Woman"		exec xsetroot -bg White -fg Black -bitmap /usr/include/X11/bitmaps/woman &
	Exec	"Yoda"		exec xv -root /dos/graphics/images/yoda.gif &
	Exec	"Lightsaber Duel"	exec xv -root /dos/windows/duel.bmp &
	Exec	"Wolverine"	exec xv -root /dos/graphics/images/wlvrine.gif &
	Exec	"Arcade"	exec xv -root /dos/windows/arcade.bmp &
	Exec	"Arches"	exec xv -root /dos/windows/arches.bmp &
	Exec	"SDF-3"		exec xv -root /dos/windows/sdf3.bmp &
EndPopUp
	
# This menu will fire up some very common utilities
Popup "Utilities"
	Title 	"Utilities"
	Nop	"" 
# I don't use xterms --  too expensive for memory.
#	Exec    "Xterm"		exec xterm &
	Exec	"EMACS"		exec emacs &
	Exec	"Calculator"	exec xcalc &
# This invokation of gnuplot doesn't work for some reason...
	Exec	"XV"		exec xv &
	PopUp	"Clocks"	Clocks
	Exec	"Manual Pages"	exec xman &
	Exec	"Magnifier"	exec xmag &
EndPopup

# This defines the most common window operations
# As with the key bindings (see below), these were appropriated from
# a stock SGI .4Dwmrc file --tabaer@magnus
Popup "Window Ops"
	Move	 "&Move          (Alt-F7)"
	Resize	 "&Resize        (Alt-F8)"
	Iconify	 "(Un)Mi&nimize  (Alt-F9)"
	Maximize "(Un)M&aximize (Alt-F10)"
	Raise	 "&Raise         (Alt-F1)"
	Lower	 "&Lower         (Alt-F3)"
	WindowList "&WinList       (Alt-F6)"
	Nop	 ""
#	Destroy	 "&Close         (Alt-F4)"
	Close	 "&Close         (Alt-F2)"
EndPopup

# 4dwm-ish root window menu --tabaer@magnus
PopUp "RootMenu"
	Title	"Tycoon"
	Nop	""
	Exec    "Remove selected icon" exec tycoon -rm
	Exec    "Shutdown tycoon"      exec tycoon -kill
	Exec    "Run tycoon"           exec tycoon
	Exec    "Add new icon"         exec newicon
	Exec    "Edit selected icon"   exec editicon
	Exec    "Lower icons"          exec tycoon -lower
	Exec    "Raise icons"          exec tycoon -raise
	Exec    "Unfreeze icons"       exec tycoon -unfreeze
	Exec    "Freeze icons"         exec tycoon -freeze
        Module  "Logout"               xquestion "Really Quit?" Quit
EndPopUp

#4dwm-ish long root window --tabaer@magnus
PopUp "LongRootMenu"
	Title	"FVWM"
	Nop	""
	Exec	"New Window"  exec /usr/bin/X11/rxvt -T xterm -font 10x20 &
	CirculateUp	"Shuffle Up"
	CirculateDown	"Shuffle Down"
	Refresh	"Refresh All"
	Nop	""
	Restart	"Restart fvwm"	fvwm
	PopUp	"Quit fvwm"	Quit-Verify
	Nop	""
	Exec	"Lock Terminal"	exec xlock -mode random &
        Module  "Logout"               xquestion "Really Quit?" Quit
EndPopUp

############################################################################
# Now define some handy complex functions

# This one moves and then raises the window if you drag the mouse,
# only raises the window if you click,  or does a RaiseLower if you double 
# click
Function "Move-or-Raise"
	Move 		"Motion"
	Raise		"Motion"
	Raise		"Click"
	RaiseLower	"DoubleClick" 
EndFunction

# This one moves and then lowers the window if you drag the mouse,
# only lowers the window if you click,  or does a RaiseLower if you double 
# click
Function "Move-or-Lower"
	Move 		"Motion"
	Lower		"Motion"
	Lower		"Click"
	RaiseLower	"DoubleClick"
EndFunction

# This one resizes and then raises the window if you drag the mouse,
# only raises the window if you click,  or does a RaiseLower if you double 
# click
Function "Resize-or-Raise"
	Resize 		"Motion"
	Raise		"Motion"
	Raise		"Click"
	RaiseLower	"DoubleClick"
EndFunction

Function "Move-or-Iconify"
	Move 		"Motion"
	PopUp		"Click" Window Ops
	Iconify		"DoubleClick"
EndFunction

# This does the Motif/MSWin thing of killing the window when you
# double-click the top left button.  Very useful if you're used
# to Windows 3.1, SGI machines, or both (like me).  --tabaer@magnus
Function "Die-on-DoubleClick"
	Destroy		"DoubleClick"
	PopUp		"Motion"	Window Ops
	PopUp		"Click"	Window Ops
EndFunction

##############################################################################
# This defines the mouse bindings

# First, for the mouse in the root window
# I use the AnyModifier option for the modifier field, so you can hold down
# any shift-control-whatever combination you want!

#     Button	Context Modifi 	Function
Mouse 1		R   	A       PopUp "LongRootMenu"
Mouse 2		R    	A      	PopUp "Utilities"
Mouse 3		R    	A      	PopUp "RootMenu"


# Now the title bar buttons
# Any button in the left title-bar button gives the window ops menu
# Any button in the right title-bar button Iconifies the window
# Note the use of "Mouse 0" for AnyButton.

#     Button	Context Modifi 	Function
Mouse 0		1    	A      	Function "Die-on-DoubleClick"
Mouse 0		4    	A     	Maximize
Mouse 0		6    	A     	Iconify
Mouse 0		2    	A      	Close
# Now the rest of the frame
# Here I invoke my complex functions for Move-or-lower, Move-or-raise,
# and Resize-or-Raise. 
# Button 1 in the corner pieces, with any modifiers, gives resize or raise
Mouse 1		FS	A	Function "Resize-or-Raise"
Mouse 2		FS	A	Function "Resize-or-Raise"
Mouse 1         T	A	Function "Move-or-Raise"
Mouse 2         T	A	Function "Move-or-Raise"
Mouse 1		I	A	Function "Move-or-Iconify"
Mouse 2		I	A	Function "Move-or-Iconify"

############################################################################
# Now some keyboard shortcuts.

# Arrow Keys
# 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
# These are "borrowed" from the .4Dwmrc file on an SGI I use,
# except for AltF2 and AltF6 which I added for completeness.
# I think the other are standard Motif.  --tabaer@magnus
Key F1		WFST	M	Raise
Key F2		WFST	M	Delete
Key F3		WFST	M	Lower
Key F4		WFST	M	Close
Key F5		WFST	M	Raise
Key F6		A	M	WindowList
Key F7		WFST	M	Move
Key F8		WFST	M	Resize
Key F9		WFST	M	Iconify
Key F10		WFST	M	Maximize

#Page Up/Dapge Down keys are used to scroll by one desktop page
# in any context, press page up/down + control
# in root context, just pressing page up/down is OK
# 
# I prefer the non-wrapping scroll. These are for example purposes only
#Key Next	A       C       Scroll 100000 0
#Key Next	R       N       Scroll 100000 0  
#Key Prior	A       C       Scroll -100000 0
#Key Prior	R       N       Scroll -100000 0


###################### GoodStuff button-bar ################################
# Colors
*GoodStuffFore Black
*GoodStuffBack #6db66db66db6

# Font
*GoodStuffFont -adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*
# Geometry - really likes to pick its own size, but giving a position is OK
*GoodStuffGeometry +0+0

# Layout: specify rows or columns, not both
*GoodStuffColumns 1

# Define the buttons to use.....

# xterm or rxvts on remote machines can be done like this
# Output re-direction is csh style, not sh style
# You will want to substitute your own hosts here!

*GoodStuff xterm  Xterm.xpm   Exec "xterm" xterm -fn 10x20&
*GoodStuff Emacs      edit.xpm    Exec "Emacs"     emacs $SELECTION&
*GoodStuff XV         xv.xpm      Exec "xv 3.10a"       xv&
*GoodStuff "       clock.xpm   Swallow "oclock" oclock -geometry 75x75+0+270  -bg gray&
*GoodStuff Netscape   netscape.xpm Exec "netscape" netscape&
*GoodStuff Minicom    phone1.xpm   Exec "Minicom" rxvt  -geometry 80x25 -T Minicom  -n Minicom -e minicom &
*GoodStuff xtelnet    telnet.xpm   Exec "Enter Host Name" /usr/local/bin/xtelnet&

########################### Pager #########################################
*FvwmPagerBack #908090
*FvwmPagerFore #484048
*FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
*FvwmPagerHilight #cab3ca
*FvwmPagerRows 1
*FvwmPagerColumns 1
*FvwmPagerGeometry 140x90-1-1
*FvwmPagerLabel 0 Pager
*FvwmPagerSmallFont 5x8
