#
# Configuration file for fvwm2
# by Lars Wirzenius
# "@(#):$Id: system.fvwm2rc,v 1.1 2003-04-07 17:04:19 ballombe Exp $"
#
# This file can be used both as the system.fvwmrc and the per-user ~/.fvwm2rc.
# It uses certain `hooks' (files stored in /etc/X11/fvwm2 or ~/.fvwm2) to allow 
# the system administrator and user to modify menus, colors, and so on without 
# having to change this file.
#
# The defaults that this file sets up follow my own taste.  They attempt to set
# up a nice, easy, comfortable environment for the "ordinary" user.  However, 
# using the hooks, it should be possible to change anything.
#
# Please read /usr/doc/fvwm2/README.sysrc for more information.
#
# Hopefully, you will never have to modify this file.
#

#
# Section: pre.hook
#
# Use pre.hook for things that need to be done before anything else.
# For example, a PixmapPath might be defined here.
#
Style "Fvwm Pager"  StaysOnTop
Style "FvwmPager"   StaysOnTop
Style "Fvwm*"       NoTitle, NoHandles, Sticky, WindowListSkip,
Style "Fvwm*"       BorderWidth 0,CirculateSkipIcon
Style "*"           SmartPlacement
Style "*"           RandomPlacement
Style "Xlock"       NoTitle
Style "xlock"       NoTitle
Module  FvwmPager 0 3
*FvwmButtons(4x1) - whatever Swallow "FvwmPager" Module FvwmPager 0 3
*FvwmPagerBack #908090
*FvwmPagerFore #484048
*FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
*FvwmPagerHilight #cab3ca
*FvwmPagerGeometry -1-1
#*FvwmPagerLabel 0 Misc
#*FvwmPagerLabel 1 Maker
#*FvwmPagerLabel 2 Mail
#*FvwmPagerLabel 3 Matlab
*FvwmPagerSmallFont 5x8


Read /etc/X11/fvwm2/pre.hook
Read .fvwm2/pre.hook


#
# Section: Various global settings
#
# These settings are personal.  If you need to modify them, do so in post.hook.
#
#
# DeskTopSize sets the size of the desktop in units of physical screen
# `pages'.  I prefer to use separate desktops instead of pages, but
# many reasonable people do it the other way.  My reason is that this
# makes it possible to have different backgrounds when changing the
# workspace.
#

DeskTopSize 3x3

#
# I don't like to be able to move between pages or desks simply by 
# moving the mouse against the screen border.  I find it very 
# confusing.  The following command disables it.
#

EdgeScroll 0 0

#
# When moving a window against the edge of the screen, it is
# nice to have a small resistance before the window is moved outside
# the screen.  This makes it easier to line windows against the
# edges.
#

EdgeResistance 0 100


#
# Section: Styles, colors, fonts, and related things
#
# This section defines the looks, behavior, and other attributes of windows.
# These are also quite personal.  Modify them in post.hook.
#
#
# The following sets window colors.  This is highly personal,
# of course.
#

Style "*" Color black/darkgrey
HilightColor white steelblue
WindowFont -adobe-helvetica-bold-r-*-*-12-*

#
# The following sets the window decorations: the window title, borders,
# and the handles in the corners.
#

ButtonStyle 2 16 20x20@1 30x20@1 50x40@1 70x20@1 80x20@1 80x30@0 60x50@0 80x80@0 70x80@0 50x60@0 30x80@0 20x80@0 20x70@0 40x50@1 20x30@0 20x20@1
ButtonStyle 4 5 25x25@1 25x75@1 75x75@0 75x25@0 25x25@1
ButtonStyle 6 2 80x76@0 20x76@1

Style "*" BorderWidth 6
Style "*" HandleWidth 6
Style "*" MWMBorder
Style "*" MWMDecor
Style "*" DecorateTransient
Style "*" SmartPlacement
Style "*" RandomPlacement
Style "*" IconBox 0 0 50 -1

Style "Fvwm*" NoTitle
Style "Fvwm*" WindowListSkip
Style "Fvwm*" CirculateSkip

Style "FvwmButtons" Sticky
Style "FvwmIconMan" Sticky

Style "FvwmIdent" Title
Style "FvwmIdent" WindowListHit
Style "FvwmIdent" CirculateHit


#
# Section: Init and restart functions
#
# This section defines the functions InitFunction and RestartFunction.
# InitFunction is executed automatically when fvwm first starts.
# RestartFunction is executed automatically when fvwm restarts itself.
# They share a common hook, init-restart.hook, and two specific hooks,
# init.hook and restart.hook.
#
# init-restart.hook should be used for starting fvwm modules, such as the
# button bar.  init-hook should be used to start other applications; they
# should not be started again, when fvwm is restarted, since they don't
# die like fvwm modules do.  restart.hook exists mostly for completeness;
# tell me if you find any use for it.
#
# InitFunction runs the script setup-background, which looks in 
# ~/.fvwm2 to see if the user wants some specific background color or
# image.
#

DestroyMenu InitFunction
AddToFunc InitFunction
+ "I" Exec setup-background
Read /etc/X11/fvwm2/init.hook
Read /etc/X11/fvwm2/init-restart.hook
Read .fvwm2/init.hook
Read .fvwm2/init-restart.hook

DestroyMenu RestartFunction
AddToFunc RestartFunction
Read /etc/X11/fvwm2/restart.hook
Read /etc/X11/fvwm2/init-restart.hook
Read .fvwm2/restart.hook
Read .fvwm2/init-restart.hook


#
# Section: Menus
#
# This section defines a small menu structure.  The main menu contains
# some typical entries, and uses a hook (main-menu.hook) to allow the
# user to add new entries.  Most of the default entries are submenus,
# which are also defined here.
#

#
# MWM style menus are easier to use and better for Windows refugees.
#

MenuStyle black grey white -adobe-helvetica-bold-r-*-*-12-* mwm

#
# The main menu.
#

###DestroyMenu MainMenu
###AddToMenu MainMenu
###+ "Main menu"		Title 	
###Read /etc/X11/fvwm2/main-menu-pre.hook
###Read .fvwm2/main-menu-pre.hook
###Read /etc/X11/fvwm2/main-menu.hook
###Read .fvwm2/main-menu.hook
###+ ""			Nop
###+ "Exit Fvwm"		Popup Quit-Verify
###
####
# Read in system and user menu definitions.
#

Read /etc/X11/fvwm2/menudefs.hook
Read .fvwm2/menudefs.hook

#
# The Window-Ops menu is for manipulating windows.  It is invoked either
# from the main menu, or directly from the root window.
#

DestroyMenu Window-Ops
AddToMenu Window-Ops
+ "Window Ops"			Title		
+ "Move"			Move
+ "Resize"			Resize
+ "Raise"			Raise
+ "Lower"			Lower 
+ "(De)Iconify"			Iconify
+ "(Un)Stick"			Stick		
+ "(Un)Maximize vertical"	Maximize 0 100
+ "(Un)Maximize horizontal"	Maximize 100 0
+ "(Un)Maximize to screen" 	Maximize 100 100
+ ""				Nop  
+ "Destroy"			Destroy
+ "Close"			Close	 

#
# Quit-Verify checks that the user really wants to exit.
#

DestroyMenu Quit-Verify
AddToMenu Quit-Verify
+ "Restart Fvwm"	Restart fvwm2
+ ""			Nop
+ "Really quit"		Quit	


#
# Section: Mouse bindings
#
# This section defines the mouse bindings, that is, all the things that
# can be done with the mouse.
#

#
# Each button gives a different menu from the background.
#

Mouse 1	R A Menu /Debian
Mouse 2	R A Menu Window-Ops
Mouse 3	R A WindowList

#
# Moving and resizing, depending on which part of the window
# you grab (T=title bar, S=side/top/bottom, F=corner).
#

Mouse 1 T A move-or-raise
Mouse 2 T A move-and-raise-or-raiselower
Mouse 3 T A move-or-lower
Mouse 0 F A resize-or-raiselower
Mouse 1 S A move-or-raise
Mouse 2 S A move-and-raise-or-raiselower
Mouse 3 S A move-or-lower


#
# Move or de-iconify an icon.
#

Mouse 0 I A move-or-winmenu-or-deiconify

#
# Buttons on the title bar (1,3,5,7,9 are on the left, 0,8,6,4,2 on
# the right side of the title bar).  Note that the bindings here
# make more sense if the ButtonStyle's defined earlier are retained.
#

Mouse 0 1 A Popup Window-Ops
Mouse 0 2 A Close
Mouse 0 4 A Maximize 0 100
Mouse 0 6 A Iconify


#
# Section: Key bindings
#
# This section binds some actions to keys.  The bindings have been inspired
# by MWM, Windows, and nightmares.  Everything that these key bindings do,
# can be done without them.  Therefore they should not be too much of a
# burden on new users, but it definitely _can_ be confusing to press a
# key by accident and have it do something completely unexpected.
#

Key Tab		A	M	Next [CurrentDesk !iconic] Focus
Key Tab		A	MS	Prev [CurrentDesk !iconic] Focus
Key Tab		A	CM	Next [CurrentDesk] deiconify-and-focus
Key Tab		A	CMS	Prev [CurrentDesk] deiconify-and-focus
Key Left	A	M	Desk -1 0
Key Up		A	M	Desk -1 0
Key Right	A	M	Desk 1 0
Key Down	A	M	Desk 1 0
Key F1		A	M	Popup Window-Ops
Key F2		A	M	Popup /Debian
Key F3		A	M	Lower
Key F4		A	M	WindowList
Key F5		A	M	CirculateUp
Key F6		A	M	CirculateDown
Key F7		A	M	Move
Key F8		A	M	Resize
Key F9		A	M	Iconify
Key F10 	A	M	Maximize

Key F1		A	C	exec /usr/bin/X11/xterm_color -sb -sl 500 -j -ls -fn 7x14 -geometry 80x30
#
# Section: Functions
#
# This section defines various functions.  Not all of these are used by
# the default bindings, but they can be useful for a user who wants to
# customize things.
#
#
# The following functions operate on a window or menu.  The
# names are systematic: foo means "do foo"; foo-or-bar means
# "do foo, if mouse is moving, bar if click"; and foo-or-bar-or-baz
# adds "baz, if double-clicked".
#

DestroyMenu move-or-winmenu-or-deiconify
AddToFunc   move-or-winmenu-or-deiconify
+ "M" Move
+ "C" Popup Window-Ops
+ "D" Iconify

DestroyMenu deiconify-and-focus
AddToFunc   deiconify-and-focus
+ "I" Iconify -1
+ "I" Focus

DestroyMenu deiconify-and-raise
AddToFunc   deiconify-and-raise
+ "I" Iconify -1
+ "I" Raise

DestroyMenu move-or-raiselower	
AddToFunc   move-or-raiselower	
+ "M" Move
+ "C" RaiseLower

DestroyMenu move-or-raise
AddToFunc   move-or-raise
+ "M" Move
+ "C" Raise

DestroyMenu move-or-lower
AddToFunc   move-or-lower
+ "M" Move
+ "C" Lower

DestroyMenu move-and-raise-or-raiselower	
AddToFunc   move-and-raise-or-raiselower	
+ "M" Move
+ "M" Raise
+ "C" RaiseLower

DestroyMenu move-or-raiselower-or-maximize-vertical
AddToFunc   move-or-raiselower-or-maximize-vertical
+ "M" Move
+ "C" RaiseLower
+ "D" Maximize 0 100

DestroyMenu resize-or-raiselower	
AddToFunc   resize-or-raiselower	
+ "M" Resize
+ "C" RaiseLower

#
# Section: post.hook
#
# Use post.hook to force things that may have been changed earlier, for
# example, key bindinds.
#

Read /etc/X11/fvwm2/post.hook
Read .fvwm2/post.hook
