# Unfortunately, order does matter in this file
# The correct order for inserting configurations is:
# 1. Colors
# 2. Assorted configuration paramters such as ClickToFocus, or MWMBorders
# 3. Path setup (ModulePath, PixmapPath, IconPath)
# 4. Style settings, including the default style Style "*" ...
# 5. InitFunction and ResetFunction definitions.
# 6. Other Functions. Functions cannot be forward referenced from
#       other functions, but they can be backward referenced.
# 7. Menus definitions. Same caveats about forward referencing
# 8. Key and Mouse Bindings.
# 9. Module options.

# The order of steps 5, 6, and 7 is not critical, as long as there are
# no forward references to functions or menus.

# If you get it wrong, the most common problem is that color or font settings
# are ignored

###########################################################################
# set up the colors
#
StdForeColor   Black
StdBackColor   #40a0c0
HiForeColor    Black
HiBackColor    #40a0c0
PagerBackColor #40a0c0

# Menu colors
MenuForeColor    Black
MenuBackColor    grey
MenuStippleColor SlateGrey

############################################################################
# Now the fonts - one for menus, another for window titles, another for icons
Font                    -*-lucida sans-bold-r-*-*-12-*-*-*-*-*-*-*
WindowFont              -*-lucida sans-bold-r-*-*-12-*-*-*-*-*-*-*
IconFont                -*-lucida sans-bold-r-*-*-12-*-*-*-*-*-*-*

###########################################################################
# Set up the major operating modes
#
########################      ICON STUFF     ##############################
IconBox 210 1 930 140

# StubbornIcons makes icons de-iconify into their original position on the
# desktop, instead of on the current page.
StubbornIcons

# With AutoPlacement, icons will normally place themselves underneath active
# windows. This option changes that.
StubbornIconPlacement

########################      MWM EMULATION     #######################
#
# My feeling is that everyone should use MWMDecorHints and MWMFunctionHints,
# since some applications depend on having the window manager respect them

# MWMFunction hints parses the function information in the MOTIF_WM_HINTS
# property, and prohibits use of these functions on the window. Appropriate
# portions of the window decorations are removed.
MWMFunctionHints

# MWM is kinda picky about what can be done to transients, and it was keeping
# me from iconifying some windows that I like to iconify, so here's an
# over-ride that will allow me to do the operation, even tough the menu
# item is shaded out.
MWMHintOverride

# MWMDecor hints parses the decoration information in the MOTIF_WM_HINTS
# property, and removes these decoratons from the window. This does not affect
# the functions that can be performed via the menus.
MWMDecorHints

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

# OpaqueMove has a number (N) attached to it (default 5).
# if the window occupies less than N% of the screen, 
# then opaque move is used. 0 <= N <= 100
OpaqueMove 0

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

# 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


########################      WINDOW PLACEMENT     #######################
# RandomPlacement prevents user interaction while placing windows:
RandomPlacement

# SmartPlacement makes new windows pop-up in blank regions of screen 
# if possible, or falls back to random or interactive placement.
SmartPlacement

# With SmartPlacement, windows will normally place themselves over icons. 
# Uncomment this to change that.
#StubbornPlacement

# NoPPosition instructs fvwm to ignore the PPosition field in window 
# geometry hints. Emacs annoyingly sets PPosition to (0,0)!
NoPPosition


###########################################################################
# 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 16

##########################################################################
# Module path and paths to the icons
#
# ModulePath is a colon-separated list, just like regular unix PATH
ModulePath /usr/local/public/lib/fvwm
PixmapPath /usr/local/public/include/X11/images
IconPath   /usr/local/public/include/X11/images

############################################################################
# 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.

# These commands should command before any menus or functions are defined,
# and before the internal pager is started.

# change the default width.
Style "*" BorderWidth 5, HandleWidth 5, Color Black/#60a0c0,Icon unknown1.xpm

Style "Fvwm*"      NoTitle, NoHandles, Sticky, WindowListSkip,BorderWidth 0
Style "Fvwm Pager" StaysOnTop
Style "FvwmPager"  StaysOnTop, Handles
Style "FvwmBanner" StaysOnTop
# Style "GoodStuff"  NoTitle, NoHandles, Sticky, WindowListSkip,BorderWidth 0
# Style "*lock"      NoTitle, NoHandles, Sticky, WindowListSkip
Style "xterm"      Icon xterm.xpm, Color black/grey
# Style "GoodStuff"  Icon toolbox.xpm
# Style "perfmeter"  NoTitle
# Style "xemacs*"    Icon page2.xpm

#---- PROGRES specific lines--------------------------------

Style "Ipsen_Input_Window" NoTitle, NoHandles, BorderWidth 0
Style "Ipsen_Tmp_Message" NoTitle
# Style "Ipsen*"     Icon rbomb.xpm

*-----------------------------------------------------------

# Change the Maximize and iconify buttons to up and down triangles.

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

#############################################################################

# Stuff to do at start-up

Function "InitFunction"
        Exec    "I"     xsetroot -solid "#40a0c0"
        Exec    "I"     exec xterm -C -geometry 80x8+0+0 -fn 7x13 &
        Exec    "I"     exec xterm -geometry 120x54+0+150 -fn 7x13 &
        Module  "I"     FvwmPager 0 0
#	Exec	"I"	exec mailtool &
#	Exec	"I"	exec clock -Wi &
#	Exec	"I"	exec cm &

EndFunction

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

Function "Move-or-Raise"
        Move            "Motion"
        Raise           "Click"
EndFunction

Function "maximize_func"
        Maximize        "Click" 0 100
        Maximize        "DoubleClick" 100 100
EndFunction


Function "Raise-or-Lower"
	RaiseLower	"Click"
EndFunction

Function "Move-or-Lower"
        Move            "Motion"
        Lower           "Motion"
        Lower           "Click"
        RaiseLower      "DoubleClick"
EndFunction

Function "Move-or-Iconify"
        Move            "Motion"
        Iconify         "DoubleClick"
EndFunction

Function "Resize-or-Raise"
        Resize          "Motion"
        Raise           "Motion"
        Raise           "Click"
        RaiseLower      "DoubleClick"
EndFunction


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

Popup "Programs"
     Title "Programs"
     Exec "Command Tool"      /usr/openwin/bin/cmdtool
     Exec "xterm"             /usr/openwin/bin/xterm
     Exec "File Manager"      /usr/openwin/bin/filemgr
     Exec "Mail Tool"         /usr/openwin/bin/mailtool
     Exec "Calendar Manager"  /usr/openwin/bin/cm
     Exec "Clock"             /usr/openwin/bin/clock
     Exec "Calculator"        /usr/openwin/bin/calctool
     Exec "Performance Meter" /usr/openwin/bin/perfmeter
     Exec "Shell Tool"        /usr/openwin/bin/shelltool
     Exec "Snapshot"          /usr/openwin/bin/snapshot
     Exec "Audio Tool"        /usr/openwin/bin/audiotool
EndPopup

Popup "Utilities"
     Title "Utilities"
     Refresh "Refresh Screen"
     Restart "Restart Fvwm" fvwm
     Exec "Lock Screen" xlock -nice 10 -mode qix -echokeys -usefirst -saturation 0
     Module  "SaveDesktop"  FvwmSave
     Exec "Console" exec xterm -C -geometry 120x54+0+150 -fn 7x13 &
EndPopup

Popup "Demos"
    Title "Demos"
    Exec "Progres monochrome" exec $PROGRESROOT/bin/Progres Demo &
    Exec  "Progres smotif"    exec $PROGRESROOT/bin/Progres -u smotif Demo &
    Exec  "Progres openlook"  exec $PROGRESROOT/bin/Progres -u openlook Demo &
EndPopup

# Popup "Remote Shell"
#       Title "Remote Shell"
#       Exec "albeniz" xterm -fn 7x13 -geometry 85x35 -e rlogin albeniz
# EndPopup

# This menu will fire up some very common utilities
Popup "Desktop"
        Title   "Desktop"
        Popup   "Programs" Programs
        Popup   "Utilities" Utilities
        Nop     ""
        Popup   "Demos" Demos
#       Popup   "Remote Shell" Remote Shell
        Nop     ""
        Quit    "Exit Fvwm"
EndPopup

# A trimmed down version of "Window Ops", good for binding to decorations
Popup "Window Ops2"
        Function        "Move"          Move-or-Raise
        Function        "Resize"        Resize-or-Raise
        Raise           "Raise"
        Lower           "Lower"
        Iconify         "Iconify"
        Stick           "(Un)Stick"
        Module          "ScrollBar"     FvwmScroll 2 2
        Close           "Dismiss"
        Nop             ""
        Destroy         "Quit"
EndPopup

#############################################################################
# One more complex function - couldn't be defined earlier because it used 
# pop-up menus
#
# This creates a motif-ish sticky menu for the title-bar window-ops
# pop-up
# Menu acts like normal twm menu if you just hold the button down,
# but if you click instead, the menu stays up, motif style
Function "window_ops_func"
        PopUp   "Click"         Window Ops2
        PopUp   "Motion"        Window Ops2
# Motif would add:
# I'll add it too, it can be mighty handy.
        Close  "DoubleClick"  
EndFunction


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

#     Button    Context Modifi  Function
Mouse 3         R       A       PopUp "Desktop"
Mouse 1         R       A       Module "winlist" FvwmWinList transient

#     Button    Context Modifi  Function
Mouse 0         1       A       Iconify
Mouse 0         2       A       Function "maximize_func"

# 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         TS      A       Function "Move-or-Raise"

# Button 2 in title or icon gives raise or lower
Mouse 2		TI	N	Function "Raise-or-Lower"

# META + Button 1 or 2 or 3 in window or icon gives move or raise
Mouse 1         WI      M       Function "Move-or-Raise"
Mouse 2         WI      M       Function "Move-or-Raise"
Mouse 3         WI      M       Function "Move-or-Raise"

# Button 1 in an icon gives move for a drag, de-iconify for a double-click,
# nothing for a single click
Mouse 1         I       A       Function "Move-or-Iconify"

# Button 3 in the corners, sides, or title-bar gives the window ops menu
Mouse 3         TSIF     A       Function "window_ops_func"

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

# press arrow in root, and scroll by full page
Key Left        R       A       Scroll -100 0
Key Right       R       A       Scroll +100 0
Key Up          R       A       Scroll 0   -100
Key Down        R       A       Scroll 0   +100

# press arrow + meta key, and scroll by full page
Key Left        A       M       Scroll -100 0
Key Right       A       M       Scroll +100 0
Key Up          A       M       Scroll 0   -100
Key Down        A       M       Scroll 0   +100

Key L5           WTSFI       N       RaiseLower
Key L7           WTSFI       N       Iconify

############################################################################
############################################################################
#Definitions used by the modules

######################### No Clutter ########################################
# I only wrote NoClutter as a simple test case, but maybe some big sites like
# universities really have usage problems (too many open windows)....
# Time delays are in seconds.
*FvwmNoClutter 3600 Iconify 1
*FvwmNoClutter 86400 Delete
*FvwmNoCLutter 172800 Destroy

########################## Window-Identifier ###############################
# Just choose colors and a fonts
*FvwmIdentBack MidnightBlue
*FvwmIdentFore Yellow
*FvwmIdentFont -*-lucida sans-medium-r-*-*-12-*-*-*-*-*-*-*

########################### Pager #########################################
*FvwmPagerBack #cccccc
*FvwmPagerFore #484048
*FvwmPagerFont -*-lucida sans-bold-r-*-*-12-*-*-*-*-*-*-*
*FvwmPagerHilight #cab3ca
*FvwmPagerGeometry 0 0
*FvwmPagerGeometry -1+0
*FvwmPagerIconGeometry -1-1
*FvwmPagerLabel 0 Virtual Desktop
*FvwmPagerSmallFont 5x8


##########################FvwmWinList##################################
*FvwmWinListBack #89a0e5
*FvwmWinListFore Black
*FvwmWinListFont -*-lucida sans-medium-r-*-*-10-*-*-*-*-*-*-*
*FvwmWinListAction Click1 Iconify -1,Focus
*FvwmWinListAction Click2 Iconify
*FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent
*FvwmWinListUseSkipList
*FvwmWinListGeometry +0-1
