# This file is copied to a new user's FVWM_USERDIR by FvwmForm-Setup form.
# This file contains the commands fvwm reads while starting.
#

EdgeResistance 250 10
EdgeScroll 100 100
ClickTime 750

DeskTopSize 1x1
MenuStyle * fvwm, Foreground white, Background cornflowerblue, Greyed grey40
MenuStyle * Font  "xft:serif:pixelsize=14;-*-times-bold-r-*-*-14-*-*-*-*-*-*-*"

ColormapFocus FollowsMouse

# default Styles:
# make sure these fonts exist on your system:
Style *           Font "xft:serif:pixelsize=18;-*-times-bold-r-*-*-18-*-*-*-*-*-*-*"
Style *           IconFont "xft:serif:pixelsize=18;-*-times-bold-r-*-*-18-*-*-*-*-*-*-*"
Style *           HilightFore black, HilightBack cornflowerblue
Style *           BorderWidth 7, HandleWidth 7
Style *           Icon unknown1.xpm, Color lightgrey/dimgrey
Style *           MWMFunctions, MWMDecor, HintOverride
Style *           DecorateTransient, NoPPosition
Style *           IconBox 0 -10 -280 -1
Style *           FocusFollowsMouse
Style *           TileCascadePlacement

# Styles for various Fvwm modules:
Style Fvwm*       NoTitle,  Sticky, WindowListSkip
Style Fvwm*       BorderWidth 2, CirculateSkipIcon, CirculateSkip
Style FvwmPager   StaysOnTop
Style FvwmBanner  StaysOnTop
Style FvwmButtons Icon toolbox.xpm, ClickToFocus

# Styles for your common terminal emulator programs.
# xterms and rxvts in a separate icon box:
Style *XTerm*       Icon xterm.xpm, SloppyFocus, IconBox -70 1 -1 -140, MWMBorder, MWMButtons
Style *rxvt*        Icon term.xpm, SloppyFocus, IconBox -70 1 -1 -140, MWMBorder, MWMButtons

# Styles for various common programs:
Style *lock       NoTitle, NoHandles, Sticky, WindowListSkip, ClickToFocus
Style xbiff       NoTitle, Sticky, WindowListSkip, ClickToFocus
Style xcalc       Icon xcalc.xpm, NoButton 2,ClickToFocus
Style xmh         Icon mail1.xpm, NoIconTitle,StickyIcon, NoButton 2
Style xman        Icon xman.xpm, ClickToFocus
Style xmag        Icon mag_glass.xpm, ClickToFocus
Style xeyes	  NoTitle


# some simple default key bindings:
Key Next         A       SCM     Next [*] Focus
Key Prior        A       SCM     Prev [*] Focus
Key Menu         A       N       Menu MenuFvwmRoot Nop

# Let's bind some keys to pan the desktop around
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
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

# Desktop navigation.
Key F1          A       M       GotoDesk 0 0
Key F2          A       M       GotoDesk 0 1
Key F3          A       M       GotoDesk 0 2
Key F4          A       M       GotoDesk 0 3
Key F5          A       M       GotoDesk 0 4
Key F6          A       M       GotoDesk 0 5
Key F7          A       M       GotoDesk 0 6
Key F8          A       M       GotoDesk 0 7
Key F9          A       M       GotoDesk 0 8
Key F10         A       M       GotoDesk 0 9
Key F11         A       M       GotoDesk 0 10
Key F12         A       M       GotoDesk 0 11

# These key bindings let the user use fvwm without a mouse
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
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

# some simple default mouse bindings:
#   for the root window:
Mouse 1 R       A       Menu MenuFvwmRoot Nop
Mouse 2 R       A       Menu MenuFvwmWindowOps Nop
Mouse 3 R       A       WindowList

#   for the title bar buttons:
Mouse 0 1       A       Menu MenuFvwmWindowOps2 Close
Mouse 0 2       A       FuncFvwmMaximize
Mouse 0 4       A       Iconify

#   for other parts of the window/borders/icons:
Mouse 1 F       A       FuncFvwmResizeOrRaise
Mouse 1 TS      A       FuncFvwmMoveOrRaise
Mouse 1 I       A       FuncFvwmMoveOrIconify
Mouse 2 I       A       Iconify
Mouse 2 FST     A       Menu MenuFvwmWindowOps2 Nop
Mouse 3 TSIF    A       RaiseLower

######################## Initialization Functions ############################
AddToFunc InitFunction
+	I Module FvwmAnimate
+	I Module FvwmTaskBar
#+	I Module FvwmButtons
+	I exec xsetroot -cursor_name left_ptr
#+	I exec xli -onroot -quiet /usr/share/wallpapers/unix_inside.gif

AddToFunc RestartFunction
+	I Module FvwmAnimate
+	I Module FvwmTaskBar
#+	I Module FvwmButtons
+	I exec xsetroot -cursor_name left_ptr
#+	I exec xli -onroot -quiet /usr/share/wallpapers/unix_inside.gif

######################## Menus ###################
DestroyMenu MenuFvwmRoot
Read /etc/X11/fvwm/menu
AddToMenu MenuFvwmRoot
+                       ""              Nop
+                       "&M. $[gt.Fvwm Modules]"      Popup MenuFvwmModules
+                       "&W. $[gt.Fvwm Window Ops]"   Popup MenuFvwmWindowOps
+                       "&S. $[gt.Fvwm Config Ops]"   Popup MenuFvwmConfig
+                       ""              Nop
+                       "&F. $[gt.Refresh Screen]"   Refresh
+                       "&C. $[gt.Recapture Screen]" Recapture
+                       ""              Nop
+                       "&X. $[gt.Exit Fvwm]" Popup MenuFvwmQuitVerify

DestroyMenu MenuFvwmConfig
AddToMenu MenuFvwmConfig "$[gt.Fvwm Config Ops]" Title
+ "&S. $[gt.Sloppy Focus]"        FuncFvwmFocusPolicyChange SloppyFocus
+ "&C. $[gt.Click To Focus]"      FuncFvwmFocusPolicyChange ClickToFocus
+ "&F. $[gt.Focus Follows Mouse]" FuncFvwmFocusPolicyChange FocusFollowsMouse
+ "" Nop
+ "&1. $[gt.Colormap Follows Mouse]" ColormapFocus FollowsMouse
+ "&2. $[gt.Colormap Follows Focus]" ColormapFocus FollowsFocus
+ "" Nop
+ "&3. $[gt.Full Paging ON]"           EdgeScroll 100 100
+ "&4. $[gt.All Paging OFF]"           EdgeScroll 0 0
+ "&5. $[gt.Horizontal Paging Only]"   EdgeScroll 100 0
+ "&6. $[gt.Vertical Paging Only]"     EdgeScroll 0 100
+ "&7. $[gt.Partial Paging]"           EdgeScroll 50 50
+ "&8. $[gt.Full Paging && Edge Wrap]" EdgeScroll 100000 100000

# The window Ops menus exhibit a different HotKey style.
# There are 2 versions of the WindowOps Menu, meant to be bound to different
# things.  Here is the "common" part:
DestroyFunc FuncFvwmWindowCommon
AddToFunc FuncFvwmWindowCommon
+ I AddToMenu $0 "$[gt.&Move]"              Move
+ I AddToMenu $0 "$[gt.&Resize]"            Resize
+ I AddToMenu $0 "$[gt.R&aise]"             Raise
+ I AddToMenu $0 "$[gt.&Lower]"             Lower
+ I AddToMenu $0 "$[gt.(De)&Iconify]"       Iconify
+ I AddToMenu $0 "$[gt.(Un)&Stick]"         Stick
+ I AddToMenu $0 "$[gt.(Un)Ma&ximize]"      Maximize
+ I AddToMenu $0 ""                 Nop
+ I AddToMenu $0 "$[gt.&Delete]"            Delete
+ I AddToMenu $0 "$[gt.&Close]"             Close
+ I AddToMenu $0 "$[gt.Destroy]"            Destroy
+ I AddToMenu $0 ""                 Nop

# First windowops menu, bound to:
# mouse 2 on root
# Root menu
DestroyMenu MenuFvwmWindowOps
AddToMenu MenuFvwmWindowOps     "$[gt.Window Ops]"    Title
FuncFvwmWindowCommon MenuFvwmWindowOps
+ "$[gt.Re&fresh Window]" RefreshWindow

# Second windowops menu, bound to:
# any mouse on titlebar button 1
# mouse 2 on frame, side or titlebar
DestroyMenu MenuFvwmWindowOps2
AddToMenu MenuFvwmWindowOps2
FuncFvwmWindowCommon MenuFvwmWindowOps2
+ Scroll&Bar       Module FvwmScroll 2 2
+ "&$[gt.Print]"           FuncFvwmPrint
+ "$[gt.Print Re&verse]" FuncFvwmPrintReverse

DestroyMenu MenuFvwmModules
AddToMenu MenuFvwmModules "$[gt.Fvwm Modules]"        Title
+ "&1. $[gt.Control Animation]" Popup  MenuFvwmAnimate
+ "&B. Button-Bar"        Module FvwmButtons
+ "&O. IconBox"           FuncFvwmConfigureIconBox
+ "&F. Forms"             Popup  MenuFvwmForms
+ "&I. Identify"          Module FvwmIdent
+ "&M. IconMan"           Module FvwmIconMan
+ "&N. Banner"            Module FvwmBanner
+ "&C. Console"           Module FvwmConsole
+ "&P. Pager"             Module FvwmPager 0 0
+ "&2. Pager (2 $[gt.desks])"   Module FvwmPager 0 1
+ "&R. Backer"            Module FvwmBacker
+ "&S. ScrollBar"         Module FvwmScroll 50 50
+ "&T. FvwmTaskBar"       Module FvwmTaskBar
+ "&U. AutoRaise"         Module FvwmAuto 200 Raise Nop
+ "&W. WinList"           Module FvwmWinList
+ "&X. $[gt.Stop Module Menu]"  Popup  MenuFvwmStopModule

DestroyMenu MenuFvwmStopModule
AddToMenu MenuFvwmStopModule "$[gt.Stop Fvwm Modules]" Title
+ "&B. $[gt.Stop] Button-Bar"  KillModule FvwmButtons
+ "&O. $[gt.Stop] IconBox"     KillModule FvwmIconBox
+ "&M. $[gt.Stop] IconMan"     KillModule FvwmIconMan
+ "&P. $[gt.Stop] Pager"       KillModule FvwmPager
+ "&R. $[gt.Stop] Backer"      KillModule FvwmBacker
+ "&S. $[gt.Stop] ScrollBar"   KillModule FvwmScroll
+ "&T. $[gt.Stop] FvwmTaskBar" KillModule FvwmTaskBar
+ "&U. $[gt.Stop] AutoRaise"   KillModule FvwmAuto
+ "&W. $[gt.Stop] WinList"     KillModule FvwmWinList

DestroyMenu MenuFvwmForms
AddToMenu MenuFvwmForms
+ "&C. Capture"       Module FvwmForm FvwmForm-Capture
+ "&D. Form Defaults" Module FvwmForm FvwmForm-Form
+ "&P. RootCursor"    Module FvwmForm FvwmForm-RootCursor
+ "&S. Setup"         Module FvwmForm FvwmForm-Setup
+ "&T. Talk Form"     Module FvwmForm FvwmForm-Talk
+ "&Q. QuitVerify"    Module FvwmForm FvwmForm-QuitVerify

# Configure and start using an iconbox on the fly
DestroyFunc FuncFvwmConfigureIconBox
AddToFunc FuncFvwmConfigureIconBox
+ I Module FvwmIconBox
+ I Style     *  NoIcon

DestroyMenu MenuFvwmQuitVerify
AddToMenu MenuFvwmQuitVerify "$[gt.Really Quit Fvwm?]" Title
+ "&Q. $[gt.Yes, Really Quit]" Quit
+ ""                     Nop
+ "&R. $[gt.Restart]"          Restart
+ ""                     Nop
+ "&N. $[gt.No, Don't Quit]"   Nop

######################## Sample Functions ##########################

DestroyFunc FuncFvwmMailXmh
AddToFunc FuncFvwmMailXmh
+ I Next [$0] Iconify false
+ I Next [$0] Focus
+ I None [$0] Exec $0 $1

DestroyFunc FuncFvwmMoveOrRaise
AddToFunc FuncFvwmMoveOrRaise
+ I Raise
+ M Move
+ D Lower

DestroyFunc FuncFvwmMaximize
AddToFunc FuncFvwmMaximize
+ M Maximize   0 100
+ H Maximize   0 100
+ C Maximize   0  80
+ D Maximize 100 100

DestroyFunc FuncFvwmMoveOrIconify
AddToFunc FuncFvwmMoveOrIconify
+ I Raise
+ M Move
+ D Iconify

DestroyFunc FuncFvwmResizeOrRaise
AddToFunc FuncFvwmResizeOrRaise
+ I Raise
+ M Resize
+ D Lower

DestroyFunc FuncFvwmPrint
AddToFunc FuncFvwmPrint
+ I Raise
+ I Exec xdpr -id $w

DestroyFunc FuncFvwmPrintReverse
AddToFunc FuncFvwmPrintReverse
+ I Raise
+ I Exec xdpr 1/2 -h -rv -id $w

DestroyFunc FuncFvwmFocusPolicyChange
AddToFunc FuncFvwmFocusPolicyChange
+ I Style * $0
+ I Recapture

# This line chooses which effect is used when (de)iconizing a window
# Random means the effect is chosen randomly each time
# Valid values are: Frame, Lines, Flip, Turn, Zoom3D, Twist Random, and None.
*FvwmAnimateEffect Random

# Read config files for modules:
read ConfigFvwmBacker
read ConfigFvwmButtons
read ConfigFvwmIconBox
read ConfigFvwmIconMan
read ConfigFvwmIdent
read ConfigFvwmPager
read ConfigFvwmScroll
read ConfigFvwmTaskBar
read ConfigFvwmWinList
