##############################
# .fvwm2rc config file 
# Configured by Staffan Hml
# 99-08-05
##############################
# 842 <=> 710
# 23  <=> 16

Read .fvwm2rc-local

# set XORvalue to something visible.  This sets the coloration of the 
# 'rubber-band' window-borders when moving and resizing windows.
XORvalue 208

# Make our windows snap-up against other windows and make icons snap
# up against other icons
SnapAttraction 20 SameType

# Font configuration
#
# WindowFont 		Sets the font to be used in window title-bars
#
# IconFont		Sets the font that will be used for icon labels.
#
WindowFont	*-helvetica-bold-r-*-11-*
IconFont	-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*

# HighlightColor
#
# This sets the textcolor and background color for the active window
# Format: HilightColor textcolor backgroundcolor
HilightColor    White #708090

# BorderStyle
# 
# This sets how the border of windows will be displayed.
# Format:  BorderStyle [state] [style] [ -- [!flag] ... ]
# State is either Active or Inactive 
# The commands below set the borders to solid colors 
#
#BorderStyle Active Solid #1ea819 -- NoInset HiddenHandles
#BorderStyle Inactive Solid #11236b -- NoInset HiddenHandles
BorderStyle             Simple -- HiddenHandles NoInset

# TitleStyle 
#
# This option sets the style of the window title-bar 
# We set the Active style to a Green vertical gradient,
# the Active (pushed down) style to the reverse of the green gradient
# and the Inactive style to a blue vertical gradient
#
# Format: TitleStyle [state] [style] [ -- [!flag] ... ]
#
#TitleStyle ActiveUp Vgradient 16 #1ea819 #065414 -- flat
#TitleStyle ActiveDown Vgradient 16 #065414 #1ea819 -- flat
#TitleStyle Inactive Vgradient 16 #11236b #03092b -- flat
TitleStyle              LeftJustified Height 14 -- Flat
AddTitleStyle   VGradient 14 2 #001022 80 #708090 20 #708090
AddTitleStyle   Pixmap 3bars.xpm -- top right

# The Second Variation of TitleStyle:
# 
# Format: TitleStyle [ justification ] [ height num ]
#
#TitleStyle LeftJustified height 14

# Button Styles
#
# Now we are going to set up the buttons
#
# The two commands we use are:
#
# ButtonStyle button [ state ] [ style ] [ -- [!]flag ... ]
#
# AddButtonStyle button [ state ] [ style ] [-- [!]flag ...]
#
# the 'button' is the number of the button you are defining, it can be
# a number from 0-9 or the word 'all' which means apply the style to all
# buttons.  
# Even button numbers are on the right, while odd button numbers are on the
# left. The lower numbers are on the outside:  13579	title	86420
#		
# First, we set all buttons to start with the same style we are using for
# the title.  Then we define the pixmaps we use as our buttons using 
# AddButtonStyle.
#ButtonStyle All -- UseTitleStyle flat
ButtonStyle 1   InActive Pixmap win_close.xpm -- top left flat
ButtonStyle 1   ActiveUp Pixmap win_close.xpm -- top left flat
ButtonStyle 1   ActiveDown Pixmap win_close_a.xpm -- top left flat
ButtonStyle 4   InActive Pixmap win_maximizeY.xpm -- top right flat
ButtonStyle 4   ActiveUp Pixmap win_maximizeY.xpm -- top right flat
ButtonStyle 4   ActiveDown Pixmap win_maximizeY_a.xpm -- top right flat
ButtonStyle 2   InActive Pixmap win_maximize.xpm -- top right flat
ButtonStyle 2   ActiveUp Pixmap win_maximize.xpm -- top right flat
ButtonStyle 2   ActiveDown Pixmap win_maximize_a.xpm -- top right flat
ButtonStyle 8   InActive Pixmap win_iconify.xpm -- top right flat
ButtonStyle 8   ActiveUp Pixmap win_iconify.xpm -- top right flat
ButtonStyle 8   ActiveDown Pixmap win_iconify_a.xpm -- top right flat
ButtonStyle 6   InActive Pixmap win_maximizeX.xpm -- top right flat
ButtonStyle 6   ActiveUp Pixmap win_maximizeX.xpm -- top right flat
ButtonStyle 6   ActiveDown Pixmap win_maximizeX_a.xpm -- top right flat

# MenuStyle
#
# MenuStyle is perhaps the most complicated configuration option. For this
# reason we suggest you read the fvwm2 man page.  However, using the 
# MenuStyle definition below, we will attempt to give you an idea of how to 
# use it.
#
# Format: MenuStyle stylename options 
#
# The StyleName is a name to indicate which menustyle you are defining.  All
# of the menus get the '*' by default. (you can change the menu style a menu
# uses with the 'changemenustyle' option)
#
# Here we set the default menu-style:
#
# Background sets the default menu background color
#
# ActiveFore sets the foreground color of the currently selected menu-item
#
# ForeGround sets the foreground color of non-selected menu-items
# 
# Popupoffset sets the offset of child-menus.  
#   Format: Popupoffset pixels percent
#	We set the percent to 100, making the child-menus pop-up to the right
#	of the existing menus.
#
# MenuFace sets the background of the menu using the 'fancy' options.
# 	Menuface is another complicated one so again, check the man-page,
#	but I'll explain the one here:
#	This menuface command sets the background of the menus to a 
#	   Horizontal gradient using 64 colors, with one pair of colors,
#	   from the color #758591 to the color #102030.
#	
# Animation turns menu animations on.  If you pop-up a submenu on the right
# 	edge of the screen, the menu will move over so it is fully visible.
#
#MenuStyle * background #455561, ActiveFore #ccfcf0, ForeGround black
#MenuStyle * MenuFace HGradient 64 1 #758591 100 #102030, Animation

#MenuStyle * mwm popupoffset 0 100
#MenuStyle * Animation, ActiveFore #ccfcf0
#MenuStyle * Background #45686B Font -adobe-helvetica-medium-r-*-10-*

MenuStyle * mwm
MenuStyle * HilightBack #7c0243
MenuStyle *  Foreground black  , Background #50609c
#232a51
MenuStyle * ActiveFore  linen
MenuStyle * Font -ttf-anson-medium-r-normal-*-*-110-*-*-p-*-iso8859-1
MenuStyle * Animation
#MenuStyle * MenuFace DGradient 128  3 "#002493"  10 "#003fff"  40 "#ff00ae" 50 "#70004c" , Animation
MenuStyle * TitleUnderlines1
MenuStyle * SeparatorsShort

# Set up some desktop options
# 
# Desktop [Horizontal]x[vertical]  Defines the virtual desktop size, 
#	1x1 = one physical screen size (no virtual desktop
DesktopSize	1x1

# EdgeResistance scrolling moving
#   Sets how hard it is to change the desktop viewport
#   scrolling is in milliseconds 
#   moving is in pixels (how far a window's edge must move to move off-screen
#
# These values don't much matter in this configuration as our viewport
# is only as big as our screen anyway.
EdgeResistance	750 75

# EdgeScroll horizontal vertical
#   Sets the percentage of a page to scroll when the cursor is on the edge
#   of the screen.   Again, not useful in this configuration since we only
#   have a viewport as big as our screen.
EdgeScroll	100 100

# OpaqueMoveSize percentage
#   This option tells fvwm the maximum size window that it should move
#   with contents intact (ie, not 'rubber-banding')  You should keep this
#   low if you don't have good video hardware.
OpaqueMoveSize 50



# Style related options
#
# Styles are used to set-up how windows are treated by the window manager.
# They allow you to change the way windows are placed, decorated and treated
# in general.  You can give different options to different windows, so that
# your xterms may be decorated differently than, say, your netscape window.
# 
# The format of the style commands are:
# 	Style windowname options
#
# The windowname is the window's name class or resource string that you want
# this option to affect.  You can use wildcards (such as * or ?), thus 
# "*" specifies options for all windows.
# The options that you can specify with the Style command are many and varied
# and really warrant a look at the fvwm2 man page.
#
#  We set up some global defaults here for all windows.
#Style "*" ForeColor grey40
#Style "*" BackColor #11236b
Style "*" ForeColor #c0c0c0
Style "*" BackColor #708090

Style "*" ClickToFocus
Style "*" SmartPlacement
Style "*" RandomPlacement
#Style "*" CleverPlacement
Style "*" StickyIcon
Style "*" IconBox 2 -140 600 -61, IconFill left bottom
Style "*" BorderWidth 5, HandleWidth 5
Style "*" NoPPosition
Style "*" NakedTransient


# Some Fvwm-Related Styles
Style "Fvwm*"	NoTitle, NoHandles, Sticky, WindowListSkip
#Style "FvwmWinList"	NoTitle 
Style "FvwmPager"	BorderWidth 0
Style "FvwmButtons"  NoTitle, NoHandles, Sticky, CirculateSkip, WindowListSkip,BorderWidth 1

# My own settings
style "XTerm"	BorderWidth 4, Handlewidth 4, Icon Monitor.xpm
style "Netscape" BorderWidth 3, Handlewidth 3, StartsOnDesk 5, SkipMapping
style "Mutt mailer" StartsOnDesk 3
Style "*clock"	BorderWidth 0,NoTitle,NoHandles,WindowListSkip,Sticky
Style "XMcd"	NoTitle
Style "*Dialog_popup" WindowListSkip
Style "*Download" WindowListSkip,NoTitle
Style "freeamp" NoTitle

# Resources for Modules
# 
# Resources are usually of the form
# *ModulenameOption value
# 
# Resources are used to configure fvwm modules. See the man page for each
# module to find out what resources you can set
#
# FvwmPager

*FvwmPagerBack #150525
*FvwmPagerFore #484058
*FvwmPagerFont -adobe-helvetica-bold-r-*-*-8-*-*-*-*-*-*-*
*FvwmPagerHilight #908090
*FvwmPagerDeskTopScale 64 
*FvwmPagerGeometry -1-1
*FvwmPagerLabel 0 Main 
*FvwmPagerSmallFont 5x8
*FvwmPagerColumns 8
*FvwmPagerBalloons Pager
*FvwmPagerBalloonfore white

# FvwmButtons

*FvwmButtonsFore black
*FvwmButtonsBack #708090
*FvwmButtonsFrame 1
*FvwmButtonsPadding 2 2
*FvwmButtonsFont lucidasanstypewriter-10

# *FvwmButtonsPixmap buttonback.xpm
*FvwmButtonsGeometry +0-0
*FvwmButtonsRows 3

*FvwmButtons    (3x3, Size 56 56 Swallow "xload" 'Exec xload -nolabel -hl black -bg "#8E8A9E" -geometry 48x48-1-1')
*FvwmButtons    (19x3 Swallow "FvwmPager" "Module FvwmPager 0 7")
*FvwmButtons    (16x3 Swallow "SystemLog" 'Exec rxvt -bg black -fg white +sb -fn 5x7 -C -T SystemLog -e tail -f /var/adm/messages')
*FvwmButtons    (3x3 Swallow "asclock" 'Exec asclock -shape -24 -position +1+1')
*FvwmButtons    (3x3, Icon gnome-term.xpm, Action 'Exec rxvt -bg black -fg white -fn fixed -sl 500 -T localhost -n localhost &')
*FvwmButtons    (3x3, Icon email.xpm, Action 'Exec xmutt &')
*FvwmButtons    (3x3, Icon netscape1.xpm, Action 'Exec netscape -geometry 800x600 &')
*FvwmButtons    (3x3, Icon Bird.xpm, Action 'Exec xlock -mode random &') 

# FvwmWinList

#*FvwmWinListBack #45686B
#*FvwmWinListFore Black
#*FvwmWinListFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
#*FvwmWinListAction Click1 Iconify -1,Focus
#*FvwmWinListAction Click2 Iconify
#*FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent
#*FvwmWinListUseSkipList
#*FvwmWinListGeometry +0-1
#*FvwmWinListShowCurrentDesk

# FvwmForm
# options for the FvwmForm module which we specify as 'Ssh' later on
*SshFore		#dfdfdf
*SshBack		#303030
*SshItemBack	black
*SshItemFore	#ffffff
*SshFont		-*-lucidatypewriter-medium-r-*-*-14-*-*-*-m-*-*-*
*SshButtonFont	-*-lucidatypewriter-medium-r-*-*-14-*-*-*-m-*-*-*
*SshInputFont	-*-lucidatypewriter-medium-r-*-*-14-*-*-*-m-*-*-*
*SshLine		Left
*SshText		"Host"
*SshInput	Host 30
*SshLine		Left
*SshText		"User"
*SshInput	User 30
*SshLine		Center
*SshButton	quit "OK"	^M
*SshCommand	Exec exec xterm -sl 1024 -cr white -fg white -bg black -T "\"$(Host)\"" -e ssh $(Host) -l $(User) &
*SshButton	quit "Cancel"	^[
*SshCommand	Nop

# Function definitions
# 
# Functions let you define more complex events than fvwm provides
#  in it's default configuration.  It allows you to do multiple things
#  when something happens... for example.  The following function
#  can be used on the titlebar of a window, and will allow you to move,
#  raise or windowshade a window when you move, click, or doubleclick 
#  the titlebar, respectively.
# "I" = Immediate (as soon as invoked), "M" = Motion (moving mouse),
# "C" = Click (press and release of mousebutton), "D" = Doubleclick
AddToFunc "Move-or-Raise" "M" Move
+              "M" Raise
+              "C" Raise
+              "D" WindowShade

AddToFunc "Move-or-Iconify" "M" Move
#+		"D" Iconify
#+		"C" RaiseLower
+		"D" PlaceAgain
+		"D" Iconify off

AddToFunc "Resize-or-Raise" "M" Resize
+              "M" Raise
+              "C" Raise
+              "D" RaiseLower

AddToFunc "InitFunction" "Immediate" Module FvwmButtons
+	       "Immediate" Module FvwmAuto 0
+	       "Immediate" Module FvwmAudio
+              "Immediate" Exec xpmroot $HOME/.fvwm/backgrounds/blue_goo.xpm &
+              "Immediate" Desk 0 2
+              "Immediate" Desk 0 0
+              "Immediate" Module FvwmAnimate

AddToFunc "RestartFunction" "Immediate" Module FvwmButtons
+	       "Immediate" Module FvwmAudio
+              "Immediate" Exec xpmroot $HOME/.fvwm/backgrounds/blue_goo.xpm &
+	       "Immediate" Module FvwmAuto 0
+              "Immediate" Module FvwmAnimate

AddToFunc "Maximize_func" "M" Maximize 0 100
+              "C" Maximize 0 80
+              "D" Maximize 100 100

# These functions (RaiseNext/RaisePrev) use "Current" to raise the 
# next/prev window even when AutoRaise is not in use.
#DestroyFunc RaiseNext 
AddToFunc RaiseNext	"I" Next (CurrentDesk !Iconic) Focus
+                 	"I" Current Raise

#DestroyFunc RaisePrev
AddToFunc RaisePrev	"I" Prev (CurrentDesk !Iconic) Focus
+               	"I" Current Raise

# Fixar vad som hnder nr man vljer nt i WindowList.
DestroyFunc WindowListFunc
AddToFunc WindowListFunc
# + "I" WindowId $0 PlaceAgain
+ "I" WindowId $0 Iconify -1
+ "I" WindowId $0 FlipFocus
+ "I" WindowId $0 Raise

# Uncomment the following line if you want that the mousepointer moves as well.
# + "I" WindowId $0 WarpToWindow 5p 5p

# Popup menus
# 
# Now we start defining menus.  The Window-popups are used for 
# window-operations.
# 
# Application and root-menu definitions come later
AddToMenu "Window-Popup" "Window Ops" Title
+              "Move" Function Move-or-Raise
+              "Resize" Function Resize-or-Raise
+              "Raise" Raise
+              "Lower" Lower
+              "(De)Iconify" Iconify
+              "(Un)Stick" Stick
+              "(Un)Maximize" Function maximize_func
+              "Identify" Module FvwmIdent
+              "" Nop
+              "Destroy" Destroy
+              "Close" Close
+              "" Nop
+              "Refresh Screen" Refresh

AddToMenu "Window-ops-Popup" "Move" Function Move-or-Raise
+              "Resize" Function Resize-or-Raise
+              "Raise" Raise
+              "Lower" Lower
+              "Iconify" Iconify
+              "(Un)Stick" Stick
+              "Identify" Module FvwmIdent
+              "" Nop
+              "Destroy" Destroy
+              "Close" Close
+              "" Nop
+              "Scrollbar" Module FvwmScroll 2 2


# Key bindings
#   
#  Now we set-up some hot-keys.  
#  The format for Key-bindings is:
#
#  Key keyname context modifier function
#
#  context describes where the binding applies, W for an application window,
#     R for root window, A for anywhere, T for title, etc.
#     S = Selected window (even when mouse isn't over it)
#  modifier is keyboard meta-keys which should be pressed, N for none,
#     S for Shift, M for Meta, C for Control, or A for any. You can combine
#     these, so things like SM (shift-Meta) are valid.
#
Key F3 W M Iconify 
Key F3 I M Iconify 
Key F4 W M Close 
Key F12 A C Exec exec xlock -mode swarm &
Key F8 SW N PlaceAgain
Key F9 SW N Iconify
Key F10 SW N Maximize 100 0
Key F11 SW N Maximize 0 -58p
Key F12 SW N Maximize 100 -58p
Key 1 A M Desk 0 0
Key 2 A M Desk 0 1
Key 3 A M Desk 0 2
Key 4 A M Desk 0 3
Key 5 A M Desk 0 4  
Key 6 A M Desk 0 5  
Key 7 A M Desk 0 6  
Key 8 A M Desk 0 7  
Key Tab A CM WindowList NoGeometryWithInfo

# These are some neat ones.  They allow you to hit control-<Arrow-key>
# to switch focus to the window next to your current window in that direction.
# Some people don't like this, if you don't, comment out these lines
#
Key Right A C Direction East (CurrentDesk !Iconic) Focus
Key Left A C Direction West (CurrentDesk !Iconic) Focus
Key Up A C Direction North (CurrentDesk !Iconic) Focus
Key Down A C Direction South (CurrentDesk !Iconic) Focus

# Familiar alt-tabbing
Key Tab A M RaiseNext
Key Tab A SM RaisePrev

# Mouse bindings
# 
# Mouse bindings work in very much the same way as key bindings
#
# Format:  Mouse Button Context Modifiers function
#
# Context: R - Root window, W - Application window, T - Window title,
# S - Window side, top or bottom bar, F - Window frame (corners), I - Icon
# window, or 0 through 9 for title-bar buttions. Or any combination.
# Modifiers: N - No modifier, C - Control, S - Shift, M - Meta, A - Any
# 
Mouse 1 R N Menu "Utilities" Nop
#Mouse 2 R N Menu "Window-Popup" Nop 
Mouse 2 R N Menu "Remote-Popup" Nop
Mouse 3 R N WindowList NoGeometryWithInfo
# NoGeometry
# Module FvwmWinList transient
Mouse 1 1 N Delete
Mouse 3 1 N Menu "Window-ops-Popup" Nop 
Mouse 1 2 N Maximize 100 -58p
Mouse 3 2 N Function "Resize-or-Raise"
Mouse 1 4 N Maximize 0 -58p
Mouse 1 6 N Maximize 100 0
Mouse 1 8 N Iconify 
Mouse 1 T N Function "Move-or-Raise"
Mouse 1 W M Function "Move-or-Raise"
Mouse 1 SF N Function "Resize-or-Raise"
Mouse 3 T N RaiseLower 
Mouse 1 I N Function "Move-or-Iconify"
Mouse 3 I N Function "Move-or-Iconify"
Mouse 2 TSFI N Menu "Window-ops-Popup" Nop
Mouse 3 S N Function "Move-or-Iconify"


#
# Read the menus from the file $HOME/.fvwm2rc-menus
#
Read .fvwm2rc-menus
