###########
#  ____________________________
# (   _________________________)
#  ) (__  _  _  _    _  
# (   __)( \/ )( \/\/ )/\/\
#  ) (    \  /  \    //    \
# (___)    \/    \/\/(_/\/\_) 2.5.10
#
# My personal fvwm2rc file
#
#######################

#####
# Set Environment variables
###########
SetEnv fvwm_home $[HOME]/tmp/.fvwm
SetEnv fvwm_img $[fvwm_home]/images
SetEnv fvwm_icon $[fvwm_home]/icons
SetEnv fvwm_scrpt $[fvwm_home]/scripts
SetEnv fvwm_wallpapers $[fvwm_img]/wallpaper

#####
# Set the image path
###########
ImagePath $[fvwm_icon]:$[fvwm_icon];.png:+

#####
# Virtual Desktops
###########
DesktopSize 3x3
DesktopName 0 Main
DesktopName 1 Work
DesktopName 2 Games
EdgeScroll 100 100
EdgeResistance 150  150
EdgeThickness 1

#####
# Mouse and Focus Behavior
###########
ClickTime 350
DoubleClickTime 500
MoveThreshold 3
Style * SloppyFocus, MouseFocusClickRaises

EwmhBaseStruts 62 162 0 48
IgnoreModifiers L25

#####
# Global Styles and options
###########
Style * TileCascadePlacement, GrabFocusOff
Style * NoPPosition, ResizeOpaque
OpaqueMoveSize -1
Emulate MWM
HideGeometryWindow Never
SnapAttraction 5 SameType Screen
SnapGrid 3 3
XorValue 55555
Style * DecorateTransient, DontRaiseTransient
Style * DontLowerTransient, StackTransientParent
Style * GrabFocusTransientOff
Style * WindowShadeSteps 20, WindowShadeScrolls
SetAnimation  10  -.01 0 .01 .03 .08 .18 .3 .45 .6 .75 .85 .90 .94 .97 .99 1.0
Style * MwmDecor, SlipperyIcon
Style * IconBox screen w 15 15 -165 -15, IconGrid 3 3, IconFill right top

#####
# Program Styles
###########
Style "*" Icon 48x48/x.png, MiniIcon mini/x.png
Style "XTerm" Icon 48x48/terminal.png, NoActiveIconOverride, MiniIcon mini/terminal.png
Style "gvim" Icon 48x48/vim.png, IconOverride, MiniIcon mini/vim.png, EWMHMiniIconOverride
Style "Firefox-bin" Icon 48x48/firefox.png, MiniIcon mini/firefox.png, EWMHMiniIconOverride
Style "irssi" Icon 48x48/irc.png, MiniIcon mini/irc.png
Style "xmms" WindowListSkip, CirculateSkip

#####
# Basic Functions
###########
DestroyFunc FvwmDeleteOrDestroy
AddToFunc   FvwmDeleteOrDestroy
+ H Nop
+ M Nop
+ C Delete
+ D Destroy

DestroyFunc FvwmIconifyOrShade
AddToFunc   FvwmIconifyOrShade
+ C Iconify
+ D WindowShade

DestroyFunc FvwmMaximize
AddToFunc   FvwmMaximize
+ H Nop
+ M Nop
+ C Maximize $0 $1

DestroyFunc FvwmMoveOrIconify
AddToFunc   FvwmMoveOrIconify
+ M Move
+ D Iconify

DestroyFunc FvwmWindowShade
AddToFunc   FvwmWindowShade
+ D WindowShade $0

#####
# Program Launching Functions
###########
DestroyFunc FvwmXTerm
AddToFunc   FvwmXTerm
+ I Exec exec xterm

DestroyFunc FvwmATerm
AddToFunc   FvwmATerm
+ I Exec exec aterm

DestroyFunc FvwmGVim
AddToFunc   FvwmGVim
+ I Exec exec gvim

DestroyFunc FvwmGimp
AddToFunc   FvwmGimp
+ I Exec exec gimp-2.0

DestroyFunc FvwmFireFox
AddToFunc   FvwmFireFox
+ I Exec exec firefox

DestroyFunc FvwmIrssi
AddToFunc   FvwmIrssi
+ I Exec exec aterm -e irssi

DestroyFunc FvwmXmms
AddToFunc   FvwmXmms
+ I Exec exec xmms

DestroyFunc FvwmViewManPage
AddToFunc   FvwmViewManPage
+ I Exec exec xterm -fg White -bg DarkBlue -g 80x40 -fn 7x14 -fb 7x14bold \
 -n "Manual Page - $0" -T "Manual Page - $0" -e man "$0"

#####
# Startup Functions
###########
DestroyFunc StartFunction
AddToFunc   StartFunction
+ I Module FvwmTaskBar
+ I Module FvwmPager 0 2
+ I Module FvwmButtons MyButtons

DestroyFunc InitFunction
AddToFunc   InitFunction
+ I Exec exec xscreensaver
+ I Exec exec fvwm-root -r $[fvwm_wallpapers]/background.png
+ I FvwmXmms
+ I FvwmATerm

DestroyFunc RestartFunction
AddToFunc   RestartFunction
+ I Nop

#####
# Screenshot Functions (uses ImageMagick)
###########
DestroyFunc FvwmWindowScreenshot
AddToFunc   FvwmWindowScreenshot
+ I ThisWindow (!Shaded !Iconic Iconifiable) \
  Exec import -window $[w.id] -quality 100 -silent \
  "$[fvwm_home]/screenshot/screenshot-`date +%F[%R]`.$[w.id].jpg"

DestroyFunc FvwmDesktopScreenshot
AddToFunc   FvwmDesktopScreenshot
+ I Exec sleep $0; import -window root -quality 100 -silent \
  "$[fvwm_home]/screenshot/screenshot-`date +%F[%R]`.jpg"

#####
# XRoach Invasion
###########
DestroyFunc XRoachInvasion
AddToFunc   XRoachInvasion
+ I Exec exec xroach -roaches 5 -rc Cyan -speed 17
+ I Exec exec xroach -roaches 3 -rc Red -speed 15
+ I Exec exec xroach -roaches 7 -rc Green -speed 10
+ I Exec exec xroach -roaches 3 -rc Blue -speed 20
+ I Exec exec xroach -roaches 1 -rc Black -speed 30
+ I Exec exec xroach -roaches 1 -rc White -speed 40

DestroyFunc XRoachExterminate
AddToFunc   XRoachExterminate
+ I Exec killall xroach

#####
# Basic Bindings
###########
Key F1 A M Menu MenuFvwmRoot
Key Tab A M WindowList Root c c NoDeskSort, SelectOnRelease Meta_L
Key Super_L A A FvwmATerm
Mouse 1 R A Menu FvwmRootMenu
Mouse 3 R A Menu FvwmWindowOpsMenu
Mouse 1 1 A FvwmDeleteOrDestroy
Mouse 1 3 A FvwmIconifyOrShade
Mouse 1 5 A FvwmMaximize 100 100
Mouse 2 5 A FvwmMaximize 0 100
Mouse 3 5 A FvwmMaximize 100 0
Mouse 1 W M FvwmMoveOrIconify
Mouse 1 I A FvwmMoveOrIconify
Mouse 4 T A FvwmWindowShade True
Mouse 5 T A FvwmWindowShade False

#####
# Window Colorsets
###########
Colorset 3 fg #101060, bg #e6e7d7
Colorset 4 fg Black, bg #a6a797
Colorset 5 fg White, bg Black

#####
# Window Decor
###########
DestroyDecor MyDecor
AddToDecor   MyDecor
+ TitleStyle LeftJustified Height 18
+ ButtonStyle 1 ActiveUp Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
+ ButtonStyle 1 ActiveDown Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
+ ButtonStyle 1 Inactive Vector 4 30x30@3 60x60@3 60x30@4 30x60@3 -- Flat
+ ButtonStyle 3 ActiveUp Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
+ ButtonStyle 3 ActiveDown Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
+ ButtonStyle 3 Inactive Vector 5 30x60@3 60x60@3 60x50@3 30x50@3 30x60@3 -- Flat
+ ButtonStyle 5 ActiveUp Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
+ ButtonStyle 5 ActiveDown Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
+ ButtonStyle 5 Inactive Vector 7 30x30@3 30x60@3 60x60@3 60x30@3 30x30@3 30x35@3 60x35@3 -- Flat
+ TitleStyle -- Flat
+ BorderStyle Simple -- NoInset Flat
+ ButtonStyle All -- UseTitleStyle

#####
# Ukkosta Decor
###########
DestroyDecor UkkostaDecor
AddToDecor   UkkostaDecor
+ TitleStyle LeftJustified Height 24
+ ButtonStyle 1 \
        ActiveUp     (Pixmap $[fvwm_img]/button/close-activeup.png -- Flat) \
        ActiveDown   (Pixmap $[fvwm_img]/button/close-activedown.png -- Flat) \
        Inactive     (Pixmap $[fvwm_img]/button/inactive.png -- Flat)
+ ButtonStyle 3 \
        ActiveUp     (Pixmap $[fvwm_img]/button/iconify-activeup.png -- Flat) \
        ActiveDown   (Pixmap $[fvwm_img]/button/iconify-activedown.png -- Flat) \
        Inactive     (Pixmap $[fvwm_img]/button/inactive.png -- Flat)
+ ButtonStyle 5 \
        ActiveUp     (Pixmap $[fvwm_img]/button/maximize-activeup.png -- Flat) \
        ActiveDown   (Pixmap $[fvwm_img]/button/maximize-activedown.png -- Flat) \
        Inactive     (Pixmap $[fvwm_img]/button/inactive.png -- Flat)
+ ButtonStyle 1 - Clear
+ ButtonStyle 3 - Clear MwmDecorMin
+ ButtonStyle 5 - Clear MwmDecorMax
+ TitleStyle AllActive MultiPixmap \
        Main AdjustedPixmap $[fvwm_img]/decor/title-main-active.xpm, \
        LeftEnd AdjustedPixmap $[fvwm_img]/decor/title-leftend-active.xpm, \
        RightEnd AdjustedPixmap $[fvwm_img]/decor/title-rightend-active.xpm, \
        UnderText AdjustedPixmap $[fvwm_img]/decor/title-undertext-active.xpm, \
        LeftOfText AdjustedPixmap $[fvwm_img]/decor/title-leftoftext-active.xpm, \
        RightOfext AdjustedPixmap $[fvwm_img]/decor/title-rightoftext-active.xpm
+ TitleStyle AllInactive MultiPixmap \
        Main AdjustedPixmap $[fvwm_img]/decor/title-main-inactive.xpm, \
        LeftEnd AdjustedPixmap $[fvwm_img]/decor/title-leftend-inactive.xpm, \
        RightEnd AdjustedPixmap $[fvwm_img]/decor/title-rightend-inactive.xpm, \
        UnderText AdjustedPixmap $[fvwm_img]/decor/title-undertext-inactive.xpm, \
        LeftOfText AdjustedPixmap $[fvwm_img]/decor/title-leftoftext-inactive.xpm, \
        RightOfext AdjustedPixmap $[fvwm_img]/decor/title-rightoftext-inactive.xpm
+ TitleStyle -- Flat
+ BorderStyle Simple -- NoInset Flat
+ ButtonStyle All -- UseTitleStyle

#####
# Window Styles
###########
Style "*" UseDecor MyDecor
Style "*" Font "xft:Sans:Bold:size=8:minspace=False:antialias=True"
Style "*" BorderWidth 1, HandleWidth 1
Style "*" MWMBorder, FirmBorder
Style "*" Colorset 4
Style "*" HilightColorset 3
Style "*" BorderColorset 5
Style "*" HilightBorderColorset 4

#####
# Menu Colorsets
###########
Colorset 8 fg DarkRed, bg #e6e7d7, sh Black, hi #202070
Colorset 7 fg Black, Translucent White 75, \
  hi Black, sh Black

#####
# MenuStyles
###########
MenuStyle * PopupDelayed, PopupDelay 300, PopdownImmediately
MenuStyle * PopupOffset -5 100, TitleWarpOff
MenuStyle * TitleUnderlines2, SeparatorsLong, TrianglesSolid
MenuStyle * AnimationOff, AutomaticHotkeysOff
MenuStyle * BorderWidth 2
MenuStyle * PopupAsSubmenu, HoldSubmenus, SubmenusRight
MenuStyle * ItemFormat "%|%5.5i%1.3l%2.3>%|"
MenuStyle * VerticalItemSpacing 1 1, VerticalTitleSpacing 2 2
MenuStyle * MenuColorset 7
MenuStyle * ActiveFore, Hilight3DOff
MenuStyle * ActiveColorset 8
MenuStyle * Font "Shadow=2:xft:Sans:Bold:size=11:antialias=True"

#####
# FvwmRootMenu
###########
DestroyMenu FvwmRootMenu
AddToMenu   FvwmRootMenu "Root Menu" Title
+ "Programs%menu/programs.png%"  Popup FvwmProgramsMenu
+ "Console%menu/terminal.png%"  FvwmATerm
+ "FVWM Console%menu/terminal.png%"  Module FvwmConsole
+ "" Nop
+ "Help%menu/help.png%"  Popup FvwmManPagesMenu
+ "Restart FVWM%menu/restart.png%"  Restart
+ "Quit FVWM%menu/quit.png%"  Quit

#####
# Programs Menu
###########
DestroyMenu FvwmProgramsMenu
AddToMenu   FvwmProgramsMenu "Programs" Title
+ "GVim%menu/vim.png%"  FvwmGVim
+ "Gimp%menu/gimp.png%"  FvwmGimp
+ "FireFox%menu/firefox.png%"  FvwmFireFox
+ "Irssi%menu/irc.png%"  FvwmIrssi
+ "Xmms%menu/xmms.png%"  FvwmXmms
+ "XRoach-Invasion%menu/xroach.png%"  XRoachInvasion
+ "XRoach-Exterminate%menu/xroach.png%"  XRoachExterminate

#####
# FVWM Help Menu
###########
DestroyMenu FvwmManPagesMenu
AddToMenu   FvwmManPagesMenu "FVWM Man Pages" Title
+ "%menu/help.png%fvwm"                FvwmViewManPage fvwm
+ "%menu/help.png%FvwmAnimate"         FvwmViewManPage FvwmAnimate
+ "%menu/help.png%FvwmAuto"            FvwmViewManPage FvwmAuto
+ "%menu/help.png%FvwmBacker"          FvwmViewManPage FvwmBacker
+ "%menu/help.png%FvwmBanner"          FvwmViewManPage FvwmBanner
+ "%menu/help.png%FvwmButtons"         FvwmViewManPage FvwmButtons
+ "%menu/help.png%FvwmCommand"         FvwmViewManPage FvwmCommand
+ "%menu/help.png%FvwmConsole"         FvwmViewManPage FvwmConsole
+ "%menu/help.png%FvwmConsoleC.pl"     FvwmViewManPage FvwmConsoleC.pl
+ "%menu/help.png%FvwmCpp"             FvwmViewManPage FvwmCpp
+ "%menu/help.png%FvwmDebug"           FvwmViewManPage FvwmDebug
+ "%menu/help.png%FvwmDragWell"        FvwmViewManPage FvwmDragWell
+ "%menu/help.png%FvwmEvent"           FvwmViewManPage FvwmEvent
+ "%menu/help.png%FvwmForm"            FvwmViewManPage FvwmForm
+ "%menu/help.png%FvwmGtk"             FvwmViewManPage FvwmGtk
+ "%menu/help.png%FvwmGtkDebug"        FvwmViewManPage FvwmGtkDebug
+ "%menu/help.png%FvwmIconBox"         FvwmViewManPage FvwmIconBox
+ "%menu/help.png%FvwmIconMan"         FvwmViewManPage FvwmIconMan
+ "%menu/help.png%FvwmIdent"           FvwmViewManPage FvwmIdent
+ "%menu/help.png%FvwmM4"              FvwmViewManPage FvwmM4
+ "%menu/help.png%FvwmPager"           FvwmViewManPage FvwmPager
+ "%menu/help.png%FvwmPerl"            FvwmViewManPage FvwmPerl
+ "%menu/help.png%FvwmProxy"           FvwmViewManPage FvwmProxy
+ "%menu/help.png%FvwmRearrange"       FvwmViewManPage FvwmRearrange
+ "%menu/help.png%FvwmSave"            FvwmViewManPage FvwmSave
+ "%menu/help.png%FvwmSaveDesk"        FvwmViewManPage FvwmSaveDesk
+ "%menu/help.png%FvwmScript"          FvwmViewManPage FvwmScript
+ "%menu/help.png%FvwmScroll"          FvwmViewManPage FvwmScroll
+ "%menu/help.png%FvwmTaskBar"         FvwmViewManPage FvwmTaskBar
+ "%menu/help.png%FvwmTheme"           FvwmViewManPage FvwmTheme
+ "%menu/help.png%FvwmWharf"           FvwmViewManPage FvwmWharf
+ "%menu/help.png%FvwmWinList"         FvwmViewManPage FvwmWinList
+ "%menu/help.png%FvwmWindowMenu"      FvwmViewManPage FvwmWindowMenu
+ "" Nop
+ "%menu/help.png%fvwm-config"         FvwmViewManPage fvwm-config
+ "%menu/help.png%fvwm-perllib"        FvwmViewManPage fvwm-perllib
+ "%menu/help.png%fvwm-root"           FvwmViewManPage fvwm-root
+ "%menu/help.png%fvwm-bug"            FvwmViewManPage fvwm-bug
+ "%menu/help.png%fvwm-convert-2.2"    FvwmViewManPage fvwm-convert-2.2
+ "%menu/help.png%fvwm-convert-2.4"    FvwmViewManPage fvwm-convert-2.4
+ "" Nop
+ "%menu/help.png%fvwm-menu-desktop"   FvwmViewManPage fvwm-menu-desktop
+ "%menu/help.png%fvwm-menu-directory" FvwmViewManPage fvwm-menu-directory
+ "%menu/help.png%fvwm-menu-headlines" FvwmViewManPage fvwm-menu-headlines
+ "%menu/help.png%fvwm-menu-xlock"     FvwmViewManPage fvwm-menu-xlock

#####
# fvwm Window Operation Menu
###########
DestroyMenu FvwmWindowOpsMenu
AddToMenu   FvwmWindowOpsMenu "Window Operations" Title
+ "Move%menu/window-move.xpm%"  Move
+ "Resize%menu/window-resize.xpm%"  Resize
+ "(De)Iconify%menu/window-iconify.xpm%"  Iconify
+ "(Un)Maximize%menu/window-maximize.xpm%"  Maximize
+ "(Un)Shade%menu/window-shade.xpm%"  WindowShade
+ "(Un)Stick%menu/window-stick.xpm%"  Stick
+ "" Nop
+ "Close%menu/window-close.xpm%"  Close
+ "Delete%menu/window-delete.xpm%"  Delete
+ "Destroy%menu/window-destroy.xpm%"  Destroy
+ "" Nop
+ "StaysOnTop%menu/window-raise.xpm%"  Pick (CirculateHit) Layer 0 6
+ "Layer +1%menu/window-raise.xpm%"  Pick (CirculateHit) Layer +1
+ "StaysPut%menu/window.xpm%"  Pick (CirculateHit) Layer 0 4
+ "Layer -1%menu/window-lower.xpm%"  Pick (CirculateHit) Layer -1
+ "StaysOnBottom%menu/window-lower.xpm%"  Pick (CirculateHit) Layer 0 2
+ "" Nop
+ "%menu/window.xpm%Window Screenshot"  Pick (CirculateHit) FvwmWindowScreenshot
+ "%menu/display.xpm%Screenshot" FvwmDesktopScreenshot 5
+ "" Nop
+ "Identify%menu/window-identify.xpm%"  Module FvwmIdent

#####
# Module Colorsets
###########
Colorset 9 fg rgb:00/00/00, hi rgb:00/00/00, sh rgb:00/00/00, bg rgb:e9/e9/d9
Colorset 10 fg rgb:00/00/00, hi rgb:dd/00/00, sh rgb:dd/00/00, bg rgb:fb/fc/ec

#####
# FvwmIdent
###########
DestroyModuleConfig FvwmIdent: *
*FvwmIdent: Colorset 9
*FvwmIdent: Font "xft:Sans:Bold:size=12:antialias=True"

#####
# FvwmTaskBar
###########
Style "FvwmTaskBar" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
  CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable

DestroyModuleConfig FvwmTaskBar: *
*FvwmTaskBar: Geometry +0-0
*FvwmTaskBar: Rows 3
*FvwmTaskBar: Font "xft:Sans:Bold:pixelsize=12:minispace=True:antialias=True"
*FvwmTaskBar: SelFont "xft:Sans:Bold:pixelsize=12:minispace=True:antialias=True"
*FvwmTaskBar: StatusFont "xft:Sans:Bold:pixelsize=12:minispace=True:antialias=True"
*FvwmTaskBar: Colorset 9
*FvwmTaskBar: IconColorset 9
*FvwmTaskBar: FocusColorset 9
*FvwmTaskBar: TipsColorset 9
*FvwmTaskBar: UseSkipList
*FvwmTaskBar: UseIconNames
*FvwmTaskBar: ShowTips
*FvwmTaskBar: StartName FVWM
*FvwmTaskBar: StartMenu FvwmRootMenu
*FvwmTaskBar: Button Title ATerm, Icon mini/xterm.png, Action (Mouse 1) FvwmATerm
*FvwmTaskBar: Action Click3 Menu FvwmWindowOpsMenu
*FvwmTaskBar: StartIcon mini/fvwm.png

#####
# FvwmPager
###########
Style "FvwmPager" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
  CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable

DestroyModuleConfig FvwmPager: *
*FvwmPager: Geometry 150x480-0+0
*FvwmPager: Colorset * 9
*FvwmPager: HilightColorset * 10
*FvwmPager: BalloonColorset * 9
*FvwmPager: WindowColorsets 9 10
*FvwmPager: Font "xft:Sans:Bold:pixelsize=12:minspace=True:antialias=True"
*FvwmPager: Balloons All
*FvwmPager: BalloonFont "xft:Sans:Bold:pixelsize=12:minspace=True:antialias=True"
*FvwmPager: BallonYOffset +2
*FvwmPager: Window3dBorders
*FvwmPager: MiniIcons
*FvwmPager: UseSkipList
*FvwmPager: Rows 3

#####
# MyButtons
###########
Style "MyButtons" NoTitle, !Handles, !Borders, Sticky, WindowListSkip, \
  CirculateSkip, StaysOnBottom, FixedPosition, FixedSize, !Iconifiable

DestroyModuleConfig MyButtons: *
*MyButtons: Geometry 60x420+0+0
*MyButtons: Colorset 9
*MyButtons: Rows 38
*MyButtons: Columns 1
*MyButtons: Frame 0
*MyButtons: Font "Shadow=3:xft:Sans:Bold:pixelsize=14:minspace=True:antialias=True"
*MyButtons: (1x2, Frame 0, Title(Center) "FVWM")
*MyButtons: (1x5, Frame 0, Icon 48x48/terminal.png, \
  Action(Mouse 1) "FvwmATerm", \
  Action(Mouse 3) "FvwmXTerm")
*MyButtons: (1x5, Frame 0, Icon 48x48/xmms.png, \
  Action(Mouse 1) "FvwmXmms")
*MyButtons: (1x5, Frame 0, Icon 48x48/vim.png, \
  Action(Mouse 1) "FvwmGvim")
*MyButtons: (1x5, Frame 0, Icon 48x48/gimp.png, \
  Action(Mouse 1) "FvwmGimp")
*MyButtons: (1x5, Frame 0, Icon 48x48/firefox.png, \
  Action(Mosue 1) "FvwmFireFox")
*MyButtons: (1x5, Frame 0, Icon 48x48/irc.png, \
  Action(Mouse 1) "FvwmIrssi")
*MyButtons: (1x5, Frame 0, Icon 48x48/tux.png )
*MyButtons: (1x1, Frame 0)