# Colorset ---------------------------------------------------------------------

CleanupColorsets
Colorset 1 fg CS01FG, fgsh CS01FS, bg CS01BG, hi CS01HI, sh CS01SH
Colorset 2 fg CS02FG, fgsh CS02FS, bg CS02BG, hi CS02HI, sh CS02SH
Colorset 3 fg CS03FG, fgsh CS03FS, bg CS03BG, hi CS03HI, sh CS03SH
Colorset 4 fg CS04FG, fgsh CS04FS, bg CS04BG, hi CS04HI, sh CS04SH




# Window Styles ----------------------------------------------------------------

Style * Font		       'TTLFNT'
TitleStyle			TTLJTF
TitleStyle Height		TTLHGT
Style * BorderWidth		BDWDTH
Style * HandleWidth		BHWDTH
BorderStyle			-- BDSTYL
ButtonStyle all			-- UseTitleStyle Flat


# [ Active ]

Style * HilightColorset		2
TitleStyle ActiveUp		VGradient TTLHGT TSAU01 TSAU02 -- Flat
TitleStyle ActiveDown		VGradient TTLHGT TSAD01 TSAD02 -- Flat
AddButtonStyle 2 ActiveUp	VGradient TTLHGT BSAU01 BSAU02 -- Flat
AddButtonStyle 2 ActiveDown	VGradient TTLHGT BSAD01 BSAD02 -- Flat


# [ Inctive ]

Style * Colorset		1
TitleStyle Inactive		VGradient TTLHGT TSIA01 TSIA02 -- Flat
AddButtonStyle 2 Inactive	VGradient TTLHGT BSIA01 BSIA02 -- Flat




# Menu Styles ------------------------------------------------------------------

MenuStyle * Font	       'MNSTFT'
MenuStyle * MenuColorset	3
MenuStyle * Hilight3DOff
MenuStyle * Animation
MenuStyle * SeparatorsShort
MenuStyle * PopupOffset		000 100
MenuStyle * BorderWidth		MNBDWD
MenuStyle * ItemFormat		"%.6|%.4l%.4l%.3>%4|"
MenuStyle * VerticalItemSpacing		3 3
MenuStyle * VerticalTitleSpacing	3 3


# [ Active ]

MenuStyle * ActiveColorset	4
MenuStyle * ActiveFore
MenuStyle * HilightBack




# Cursor Styles ----------------------------------------------------------------

CursorStyle POSITION		left_ptr		CRSCOL CSBGCL
CursorStyle TITLE		left_ptr		CRSCOL CSBGCL
CursorStyle DEFAULT		left_ptr		CRSCOL CSBGCL
CursorStyle SYS			left_ptr		CRSCOL CSBGCL
CursorStyle MOVE		fleur			CRSCOL CSBGCL
CursorStyle RESIZE		sizing			CRSCOL CSBGCL
CursorStyle WAIT		watch			CRSCOL CSBGCL
CursorStyle MENU		left_ptr		CRSCOL CSBGCL
CursorStyle SELECT		crosshair		CRSCOL CSBGCL
CursorStyle DESTROY		pirate			CRSCOL CSBGCL
CursorStyle TOP			top_side		CRSCOL CSBGCL
CursorStyle RIGHT		right_side		CRSCOL CSBGCL
CursorStyle BOTTOM		bottom_side		CRSCOL CSBGCL
CursorStyle LEFT		left_side		CRSCOL CSBGCL
CursorStyle TOP_LEFT		top_left_corner		CRSCOL CSBGCL
CursorStyle TOP_RIGHT		top_right_corner	CRSCOL CSBGCL
CursorStyle BOTTOM_LEFT		bottom_left_corner	CRSCOL CSBGCL
CursorStyle BOTTOM_RIGHT	bottom_right_corner	CRSCOL CSBGCL
CursorStyle TOP_EDGE		top_side		CRSCOL CSBGCL
CursorStyle RIGHT_EDGE		right_side		CRSCOL CSBGCL
CursorStyle BOTTOM_EDGE		bottom_side		CRSCOL CSBGCL
CursorStyle LEFT_EDGE		left_side		CRSCOL CSBGCL
CursorStyle ROOT		left_ptr		CRSCOL CSBGCL
CursorStyle STROKE		plus			CRSCOL CSBGCL




# Major Operating Modes --------------------------------------------------------

HideGeometryWindow
SnapAttraction		10	SameType Screen
OpaqueMoveSize		20
EdgeScroll		0	0
EdgeResistance		750	50
DeskTopSize		3	3
ClickTime		750

Style * ResizeOutline
Style * MinOverlapPlacement
Style * ClickToFocus
Style * GrabFocus

Style sys.log		Notitle, Sticky, StaysOnBottom, NeverFocus, \
			BorderWidth 0, HandleWidth 0, WindowListSkip




# Start-up Function ------------------------------------------------------------

AddToFunc InitFunction
+ I Module		FvwmButtons MplusBar
+ I Function		SetXterm '-T $HOSTNAME:$PWD -g 80x24+0+0'

AddToFunc RestartFunction
+ I PipeRead		'[ ! `ps h -o pid -C xapm` ] || \
			kill `ps h -o pid -C xapm`'
+ I Module		FvwmButtons MplusBar




# Xterm Styles -----------------------------------------------------------------

DestroyFunc		SetXterm
AddToFunc		SetXterm

+ I Exec exec		xterm -b 4 -bg "XTBGCL" -fg "XTFGCL" \
			-cr "XTCRCL" -ms "XTPTCR" -hc "XTHLTT" $0




# Kterm Styles -----------------------------------------------------------------

DestroyFunc		SetKterm
AddToFunc		SetKterm

+ I Exec exec		kterm -b 4 -lsp 2 -bg "KTBGCL" -fg "KTFGCL" \
			-cr "KTCRCL" -ms "KTPTCR" $0




# Application Dependent Styles -------------------------------------------------

Style xmms		Notitle
Style BasiliskII	Notitle, BorderWidth 0, HandleWidth 0
Style xbattery		Notitle, BorderWidth 0, HandleWidth 0, \
			Sticky, WindowListSkip, NeverFocus




# Window Functions -------------------------------------------------------------

DestroyFunc	Move-or-Raise-or-Shade
AddToFunc	Move-or-Raise-or-Shade
+		M	Move
+		M	Raise
+		C	Raise
+		D	WindowShade




# Mouse Bindings ---------------------------------------------------------------

Mouse 1		2	A	Maximize	100 100
Mouse 3		2	A	Menu		WindowOps

Mouse 1		T	A	Function	"Move-or-Raise-or-Shade"
Mouse 1		R	A	
Mouse 2		RT	A	WindowList
Mouse 3		RT	A	Menu		ROOT




# Keyboard Bindings ------------------------------------------------------------

Key Tab		A	M	WindowList	SelectOnRelease Alt_L

Key 1		A	MS	Maximize	000 100
Key 2		A	MS	Maximize	100 000
Key 3		A	MS	Maximize	100 100
Key 4		A	MS	Menu		WindowOps

Key 1		A	CS	Menu		ROOT

Key Left	A	C	Scroll		-100 +000
Key Right	A	C	Scroll		+100 +000
Key Up		A	C	Scroll		+000 -100
Key Down	A	C	Scroll		+000 +100

Key 1		A	CM	MoveToPage	0 0
Key 2		A	CM	MoveToPage	1 0
Key 3		A	CM	MoveToPage	2 0
Key 4		A	CM	MoveToPage	0 1
Key 5		A	CM	MoveToPage	1 1
Key 6		A	CM	MoveToPage	2 1
Key 7		A	CM	MoveToPage	0 2
Key 8		A	CM	MoveToPage	1 2
Key 9		A	CM	MoveToPage	2 2

Key T		A	CM	Move		+000 +000
Key P		A	CM	Move		-000 +000
Key B		A	CM	Move		+000 -000
Key M		A	CM	Move		-000 -000

Key U		A	CM	Move		w-00p w-40p
Key D		A	CM	Move		w-00p w+40p
Key L		A	CM	Move		w-40p w-00p
Key R		A	CM	Move		w+40p w-00p

Key S		A	CM	WindowShade

Key Left	A	CM	CursorMove	-10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Right	A	CM	CursorMove	+10p +00p
Key Up		A	CM	CursorMove	+00p -10p
Key Down	A	CM	CursorMove	+00p +10p




# Window Options ---------------------------------------------------------------

DestroyFunc		WindowOps
AddToMenu		WindowOps

+ "(Un)&Stick"		Stick
+ ""			Nop
+ "Close"		Delete
+ "Kill"		Destroy
+ ""			Nop
+ "&Cancel"




# ROOT Menu --------------------------------------------------------------------

DestroyMenu		ROOT
AddToMenu		ROOT

+ "&Xterm"		SetXterm '-T $HOSTNAME:$PWD'
+ "&Kterm"		SetKterm '-T $HOSTNAME:$PWD'
+ "&Emacs"		Exec exec emacs -ib 4 -g 80x24+0+0 -lsp 2 \
			-bg "EMBGCL" -fg "EMFGCL" -cr "EMCRCL" -ms "EMMSCL"
+ ""			Nop
+ "&w3m"		SetKterm '-g 108x44+0+0 \
			-bg "W3BGCL" -fg "W3FGCL" -cr "W3CRCL" -ms "W3PTCR" \
			-T "w3m pager / www browser" -e w3m -B
+ "&Mozilla"		Exec exec mozilla
+ ""			Nop
+ "&Xmms"		Exec exec xmms
+ "&Xine"		Exec exec xine
+ "&Gimp"		Exec exec gimp
+ "&Basilisk II"	Exec exec BasiliskII
+ "&Pysol"		Exec exec /usr/local/pysol/pysol
+ "&Other..."		Popup OTHER
+ ""			Nop
+ "&M+ Styles..."	Popup SETTINGS
+ ""			Nop
+ "&Exit..."		Popup EXIT
+ "&Cancel"




# OTHER Menu -------------------------------------------------------------------

DestroyMenu		OTHER
AddToMenu		OTHER

+ "&Top"		SetXterm '-T "Top - Display top CPU processes" -e top'
+ "Xdm &Errors"		SetXterm '-T "Xdm Error Log" -e \
			tail -f /usr/X11R6/lib/X11/xdm/xdm-errors
+ "X&battery"		Exec exec xbattery -g 4xMBRHGT-0-0 \
			-font mplus_f10r -bg yellow -fg black




# SETTINGS Menu ----------------------------------------------------------------

DestroyMenu		SETTINGS
AddToMenu		SETTINGS

+ "&Style..."		Popup STYLE-SETTINGS
+ "&Background..."	Popup BACKGROUND-SETTINGS




# STYLE-SETTINGS ---------------------------------------------------------------

DestroyMenu		STYLE-SETTINGS
AddToMenu		STYLE-SETTINGS

+ "&Bluegray"		SetStyle 'bluegray'
+ "&Colors"		SetStyle 'colors'
+ "&Old Days"		SetStyle 'old_days'
+ "&Space"		SetStyle 'space'
+ "&Toy Box"		SetStyle 'toy_box'

DestroyFunc		SetStyle
AddToFunc		SetStyle

+ I PipeRead		`sed -e 's/MPLUS_STL=.*/MPLUS_STL="$0"/' \
			-e 's/CNGBGD=.*/CNGBGD="default"/' \
			$HOME/.mplus/mplusrc > $HOME/.mplus/~tmp; \
			mv $HOME/.mplus/~tmp $HOME/.mplus/mplusrc; \
			$MPLUS_DIR/build_fvwm2rc`
+ I Restart




# BACKGROUND-SETTINGS Menu -----------------------------------------------------

DestroyMenu		BACKGROUND-SETTINGS
AddToMenu		BACKGROUND-SETTINGS

+ "&Stripe Gray"	SetBackground \
			'fvwm-root $MPLUS_DIR/mplus_images/stripe-gray.xpm'
+ "&Grid Aqua"		SetBackground \
			'xsetroot -fg "#8877CC" -bg "#776666" -mod 2 2'
+ "&Grid Blue"		SetBackground \
			'xsetroot -fg "#663399" -bg "#333366" -mod 2 2'
+ "&Grid Charcoal"	SetBackground \
			'xsetroot -fg "#333311" -bg "#220022" -mod 2 2'
+ "&Grid Gray"		SetBackground \
			'xsetroot -fg "#000000" -bg "#333333" -mod 2 2'
+ "So&lid Black"	SetBackground \
			'xsetroot -solid black'

DestroyFunc		SetBackground
AddToFunc		SetBackground

+ I Exec exec		$0
+ I PipeRead		`sed "s%CNGBGD=.*%CNGBGD='$0'%" \
			$HOME/.mplus/mplusrc > $HOME/~tmp; \
			mv $HOME/~tmp $HOME/.mplus/mplusrc`




# EXIT Menu --------------------------------------------------------------------

DestroyMenu		EXIT
AddToMenu		EXIT

+ "&Restart"		Restart
+ "Switch to TWM"	Restart twm -f $HOME/.mplus/twmrc_mplus
+ "Exit"		Quit




# MplusBar ---------------------------------------------------------------------

Style MplusBar		Notitle, Sticky, StaysOnBottom, NeverFocus, \
			BorderWidth 0, HandleWidth 0, WindowListSkip
DestroyModuleConfig	MplusBar: *

*MplusBar:		ButtonGeometry 1xMBRHGT-0-0
*MplusBar:		Back MBBGCL
*MplusBar:		Columns MBWDTH
*MplusBar:		Frame 0
*MplusBar:		Font MTFONT
*MplusBar:		(MTWDTHx1, Title (Left) 'MTTEXT' \
			Back MBBGCL Fore MTFNCL Padding MTFNPD \
			Action SetXterm '-T "M+ Mouse and Keybord bindings" \
			-g 62x24 -e less  $MPLUS_DIR/binding.txt')
*MplusBar:		(MPWDTHx1, Swallow "FvwmPager" 'FvwmPager 0 0')
*MplusBar:		(MBSPCRx1)
*MplusBar:		(MCWDTHx1, Swallow "xclock" \
			'Exec exec xclock -d -update 1 -padding MBFNPD \
			-geometry -2000-2000 \
			-bg "MBBGCL" -fg "MBFNCL" -font MBFONT')




# [ Pager ]

Style FvwmPager		Notitle, Sticky, StaysOnBottom, \
			BorderWidth 0, HandleWidth 0, WindowListSkip
DestroyModuleConfig	FvwmPager: *

*FvwmPager:		Fore MBPGFC
*FvwmPager:		Back MBPGBC
*FvwmPager:		Geometry -2000-2000
*FvwmPager:		Font none
*FvwmPager:		NoDeskHilight
*FvwmPager:		SolidSeparators
*FvwmPager:		WindowBorderWidth 0
*FvwmPager:		WindowColors MBPGIW MBPGIW MBPGAW MBPGAW
