###########################################################################
# This .fvwmrc contains usefull settings for working with SISCAD-P 
#
# this is used for non-selected windows, menus, and the panner
StdForeColor 		Black
StdBackColor 		#60a0c0

# this is used for the selected window
HiForeColor 		black
HiBackColor 		#c06077

PagerBackColor		#5c54c0
PagerForeColor		orchid

############################################################################
# Now the fonts - one for menus/icons, another for window titles
Font			-adobe-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*
WindowFont		-adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*
IconFont		-adobe-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*
# PagerFont is used to mark windows in the Pager with their icon names.
# This is really only useful for DeskTopScale < 20 or so
PagerFont		5x8

###########################################################################
# Set up the major operating modes
#
# Set windows to auto-raise after 750 milliseconds if you like it.
# Autoraise can sometimes obscure pop-up windows. Performance is now
# similar to olvwm's auto-raise feature.
#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....
# IconBox  -1 -1 1 1

# 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

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

#set the desk top size in units of physical screen size
#DeskTopSize 2x3

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

# Use the Fvwm Pager
#Pager 846 1 

#The pager is automatically sticky, but I like it to StayOnTop
# StaysOnTop Fvwm Pager
#StaysOnTop Fvwm 

#The pager is automatically sticky, but I like it without a title
#NoTitle Fvwm Pager

#Might as well leave it out of the window list too...
WindowListSkip Fvwm Pager


# flip by whole pages on the edge of the screen.
EdgeScroll 100 100
# A modest delay before flipping pages seems to be nice...
# I thresh in a 50 pixel Move-resistance too, just so people
# can try it out.
EdgeResistance 250 50

############################################################################
# list the windows that don't want a title bar
NoTitle xclock
NoTitle xdclock
NoTitle Clock
NoTitle xbiff

###########################################################################
# Here's where I could list NoBorder windows that don't get frames.
# If a window shows up with NoTitle and NoBorder, it gets no decorations
# at all.
# When windows are NoBordered, they look a bit like twm is handling them
#NoBorder xterm

##########################################################################
# now the windows that "Stick to the glass", ie don't scroll with the
# desktop
Sticky xclock
Sticky xdclock
Sticky oclock
Sticky Clock
Sticky xbiff

############################################################################
# now list windows that want to "stay on top," ie stay visible until
# explicitly lowered
# I got tired of this, except for the pager.
#StaysOnTop xclock
#StaysOnTop xdclock
#StaysOnTop oclock
#StaysOnTop Clock

############################################################################
# now list windows that don't need to show up in the window list
WindowListSkip Clock
WindowListSkip xbiff
WindowListSkip xclock

############################################################################
# define some common icon bitmaps

# These are the color icons.
# Of course, you need to change the directory to the one where they
# really live.
Icon "rxvt"        /usr/include/X11/pixmaps/term.xpm
Icon "xterm"       /usr/include/X11/pixmaps/xterm.xpm
Icon "Fvwm Pager"  /usr/include/X11/pixmaps/fvwm.xpm
Icon "Appointment" /usr/include/X11/pixmaps/datebook.xpm
Icon "xcalc"       /usr/include/X11/pixmaps/xcalc.xpm
Icon "xbiff"       /usr/include/X11/pixmaps/mail1.xpm
Icon "xman"	   /usr/include/X11/pixmaps/xman.xpm
Icon ""            /usr/include/X11/pixmaps/unknown1.xpm

# Here are some monchrome icon bitmaps that everyone should have
#Icon "rxvt"	    /usr/include/X11/bitmaps/terminal
#Icon "xterm"	    /usr/include/X11/bitmaps/Term
# I have included a default.xbm in the fvwm_icons subdirectory
#Icon ""		    /usr/include/X11/bitmaps/default.xbm

##############################################################################
#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?"
	Quit	"Yes, Really Quit"
	Restart "Restart Fvwm" fvwm
	Restart "Start twm" twm
	Restart "Start mwm" mwm
	Restart "Start olwm" /usr/openwin/bin/olwm
	Restart "Start olvwm" /usr/openwin/bin/olvwm
	Nop	""
	Nop	"No, Don't Quit"
EndPopup

Popup "Shells"
	Title 	"Shells" 
	Exec	"Xterm (7x14 font)"	exec /usr/bin/X11/xterm -sb -sl 500 -j -ls -fn 7x14 &
	Exec	"Rxvt (VT100 emulator)"	exec /usr/bin/X11/rxvt -font 7x14 -fb 7x14 -ls &
	Exec	"Color Xterm (7x14 font)"	exec /usr/bin/X11/color_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

Popup "Screensaver"
	Title 	"Screensaver"
	Exec	"Random"	exec xlock -nolock -nice 0 -mode random &
	Exec	"Hop"	exec xlock -nolock -nice 0 -mode hop   &
	Exec	"Life"	exec xlock -nolock -nice 0 -mode life   & 
	Exec	"Qix"	exec xlock -nolock -nice 0 -mode qix &
	Exec	"Image"	exec xlock -nolock -nice 0 -mode image &
	Exec	"Swarm"	exec xlock -nolock -nice 0 -mode swarm & 
	Exec	"Rotor"	exec xlock -nolock -nice 0 -mode rotor &
	Exec	"Pyro"	exec xlock -nolock -nice 0 -mode pyro &
	Exec	"Flame"	exec xlock -nolock -nice 0 -mode flame &
	Exec	"Worm"	exec xlock -nolock -nice 0 -mode worm &
	Exec	"Blank"	exec xlock -nolock -nice 0 -mode blank &
EndPopup

Popup "Screenlock"
	Title 	"Lock Screen"
	Exec	"Random"	exec xlock -nice 0 -mode random &
	Exec	"Hop"	exec xlock -nice 0 -mode hop   &
	Exec	"Life"	exec xlock -nice 0 -mode life   & 
	Exec	"Qix"	exec xlock -nice 0 -mode qix &
	Exec	"Image"	exec xlock -nice 0 -mode image &
	Exec	"Swarm"	exec xlock -nice 0 -mode swarm & 
	Exec	"Rotor"	exec xlock -nice 0 -mode rotor &
	Exec	"Pyro"	exec xlock -nice 0 -mode pyro &
	Exec	"Flame"	exec xlock -nice 0 -mode flame &
	Exec	"Worm"	exec xlock -nice 0 -mode worm &
	Exec	"Blank"	exec xlock -nice 0 -mode blank &
EndPopup

Popup "Games"
        Title   "Games"
        Exec    "Tetris"        exec xtetris &
        Exec    "Puzzle"        exec puzzle &
        Exec    "Chess"         exec xboard &
        Exec    "Mahjongg"      exec xmahjongg &
EndPopup



# This defines the most common window operations
Popup "Window Ops"
	Title	"Window Ops"
	Move    "Move"
	Resize  "Resize"
	Raise   "Raise"
	Lower   "Lower"
	Iconify "(De)Iconify"
	Stick	"(Un)Stick"
	Maximize "(Un)Maximize"
	Maximize "(Un)Maximize Vertical"	0 100
	Nop     ""
	Destroy "Destroy"
	Delete  "Delete"
EndPopup

# This menu will fire up some very common utilities
Popup "Utilities"
        Title   "Utilities"
	Exec	"SISCAD-P"	exec xterm -sb -T "SISCAD-P Log" -e /usr/bin/siscadp -d &
        Exec    "Top"           exec rxvt  -font 7x14 -T Top -n Top -e top &
        Exec    "Calculator"    exec xcalc &
        Exec    "Xman"          exec xman &
        Exec    "Xmag"          exec xmag &
	Exec	"Xfilemanager"	exec xfilemanager &
	Exec	"Xfm 1.2"	exec xfm &
	Exec	"Seyon"		exec seyon -modem /dev/modem &
        Exec    "XV 3.00"       exec xv &
        Exec    "Oclock"        exec oclock &
        Nop     ""
        Popup   "Shells"        Shells
        Nop     ""
        Popup   "Screensaver"   Screensaver
        Nop     ""
        Popup   "Lock Screen"   Screenlock
        Nop     ""
        Popup   "Games"	        Games
        Nop     ""
        Popup   "Exit Fvwm"     Quit-Verify
        Nop     ""
        Refresh "Refresh Screen"
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


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

# First, for the mouse in the root window
# Button 1 gives the Utilities menu
# Button 2 gives the Window Ops menu
# Button 3 gives the WindowList (like TwmWindows)
# 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 "Utilities"
Mouse 2		R    	A      	PopUp "Window Ops"
Mouse 3		R    	A      	WindowList



# 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      	PopUp "Window Ops"
Mouse 0		2    	A     	Iconify

# 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		F	A	Function "Resize-or-Raise"
# Button 1 in the title, sides, or icon, w/ any modifiers, gives move or raise
Mouse 1		TSI	A	Function "Move-or-Raise"
# Button 2 in an icon, w/ any modifiers, gives de-iconifies
Mouse 2		I	A	Iconify
# Button 2 in the corners, sides, or title-bar gives the window ops menu
Mouse 2		FST	A	PopUp "Window Ops"
# Button 3 anywhere in the decoration (except the title-bar buttons)
# does a move-or-lower
Mouse 3		TSIF	A	Function "Move-or-Lower"


############################################################################
# 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
Key F1		A	M	Popup "Utilities"
Key F2		A	M	Popup "Window Ops"
Key F3		A	M	WindowList
Key F4		A	M	Iconify
Key F5		A	M	Move
Key F6		A	M	Resize
Key F7		A	M	CirculateUp
Key F8		A	M	CirculateDown

#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

########################################################################
#
#                   Usefull settings for SISCAD-P
#
########################################################################

PixmapPath /usr/local/fvwm/icons/:/usr/include/X11/pixmaps/:/usr/siscadp/icn

Sticky CAD-Befehle
Sticky SISCAD-P

Style "GoodStuff"  NoTitle, NoHandles, Sticky, WindowListSkip,BorderWidth 0
Style "Fvwm*"      NoTitle, NoHandles, Sticky, WindowListSkip,BorderWidth 0
  

Function "InitFunction"
	Module	"I"	GoodStuff
EndFunction

Function "RestartFunction"
	Module	"I"	GoodStuff
EndFunction


###################### GoodStuff button-bar ################################
# Colors
*GoodStuffFore Black
*GoodStuffBack #908090

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

# Layout: specify rows or columns, not both
*GoodStuffRows 2

# Define the buttons to use.....
*GoodStuff Kill    rbomb.xpm    Destroy
*GoodStuff SISDOCU  marskopf.xpm   Exec "SISDoku" (SISLANGUAGE=DEUTSCH; WWWBROWSER=Mosaic; export SISLANGUAGE WWWBROWSER ; /usr/siscadp/exe/sisdok) &
*GoodStuff SISCAD-P siscadp.xpm     Exec "SISCAD-P" xterm -g 80x15 -sb -T "SISCAD-P Log" -n SISCAD-P -e /usr/bin/siscadp -d &
*GoodStuff Xcalc    rcalc.xpm   Exec "" xcalc &
*GoodStuff -  xbiff.xpm   Swallow "xbiff" xbiff -bg \#908090 -geometry -1500-1500
*GoodStuff Paging  clamp.xpm   TogglePage
*GoodStuff -  clock.xpm   Swallow "xclock" xclock -bg \#908090 -geometry -1500-1500 -padding 0
*GoodStuff(4x1) - whatever SwallowModule "FvwmPager" FvwmPager 0 3

PagingDefault 0
SmartPlacement
BoundaryWidth 2
OpaqueMove   100
MWMMenus
MWMBorders
MWMButtons
DecorateTransients
