# 4DWM-like config for FVWM
   # By Chris <zizban@gmail.com>
   # Based on work by Yaxkukmo
   # Modified by jirka <jirka@sdf.org>
   #################
   # Image path
   #################
   #
   ImagePath $[HOME]/.fvwm/icons:+
   #Colorset 1 fg black, bg black, SGradient 4 1 red 5 grey, dither
   Colorset 8 fg black, bg #a0a0a0
   Colorset 13 fg black, bg black
   Colorset 10 fg black, bg #808080
   Colorset 11 fg black, bg #b0b0b0
   # inactive windows
   Colorset 15 fg black, bg  #808080, sh #292929
   Colorset 3 fg black, bg  #808080
   # active windows
   Colorset 16 fg black, bg  #a59f80
   #Colorset 4 fg black, bg  #a59f80
   Colorset 17 fg black, bg #808080, pixmap unknown.xpm
   #
   #################
   # default style
   #################
   Style *           !MWMFunctions, MWMDecor, HintOverride, !MWMBorders
   #
   #################
   # style for toolchest and sticky applications
   #################
   #
   Style toolchest Title, !Handles, WindowShade, !Button 1, !Button 2, !Button 4, !Closable, Sticky, !StickyStippledTitle, WindowListSkip, !Closable
   Style FvwmButtons Title, !Handles, WindowShade, !Button 1, !Button 2, !Button 4, Sticky, !StickyStippledTitle, WindowListSkip, !Closable
   Style *FvwmPager NoTitle, NoHandles, WindowShade, Button 1, !Button 2, Button 4, Sticky, !StickyStippledTitle, WindowListSkip, BorderWidth 0
   #Style rclock Title, Handles, WindowShade, Button 1, !Button 2, !Button 4, Sticky, !StickyStippledTitle, WindowListSkip
   #Style xtdesktop NoTitle, NoHandles, Sticky, WindowListSkip, staysOnBottom
   Style *stalonetray* NoTitle, !Handles, WindowShade, Sticky, WindowListSkip, BorderWidth 0
   #
   #################
   # IconSize needed to snapshots as icons
   #################
   #
   SetEnv fvwm_icon_size 93
   #
   #################
   # Starting xterm iconified
   #################
   #
   Style uxterm StartNormal
   AddToFunc StartFunction I Test (init) Exec exec xterm -bg gray10 -fg gray90 -iconic -geometry +0-0 -title "UNIX Console" -e zsh
   #
   #################
   #I think it is posible to get red cursor
   #################
   #
   CursorStyle root left_ptr white red
   OpaqueMoveSize -1
   SnapAttraction 8 SameType
   SnapGrid 1 1
   MoveThreshold 3
   BugOpts FlickeringMoveWorkAround On
   #
   #################
   # here we got SGI colors and font for windows and menu
   #################
   #
   DefaultFont "-*-helvetica-bold-*-*-*-14-*-*-*-*-*-*-*"
   Style *  BorderWidth 7, HandleWidth 7
   TitleStyle LeftJustified
   TitleStyle Height 25
   Style * NoDecorHint
   Style * GNOMEIgnoreHints
   Style * MouseFocusClickRaises
   Style * Colorset 15
   Style * HilightColorset 16
   BorderStyle -- !NoInset
   MenuStyle * PopupOffset -5 -1
   MenuStyle *  HilightBack #a3a3a3
   MenuStyle * MenuColorset 11
   MenuStyle * Hilight3DThick
   MenuStyle * !SeparatorsLong
   MenuStyle * BorderWidth 2
   *FvwmIdent: Font  "-*-helvetica-bold-*-*-*-14-*-*-*-*-*-*-*"
   #
   #################
   # Here are vector buttons and width of the border and hadlers
   #ButtonStyle 2         \
   #################
   #
   ButtonStyle 2         \
      Vector 9 0+5px100-6p@3 100-7px100-6p@3 \
      100-7px-0+4p@3 0+5px0+4p@3 0+5px100-5p@3 \
      0+7px100-5p@2 \
      0+8px100-5p@3 100-6px100-5p@3 100-6px-0+6p@3
   ButtonStyle 4          \
       Vector 9 50-2px50+1p@3 50+2px50+1p@3 50+2px50-3p@3 50-2px50-3p@3 50-2px50+2p@3 \
      50-0px50+2p@2 \
      50-0px50+2p@3 50+3px50+2p@3 50+3px50-1p@3
   ButtonStyle 1         \
      Vector 9 0+4px50+1p@3 100-6px50+1p@3 100-6px50-2p@3 0+4px50-2p@3 0+4px50+2@3 \
      0+5px50+2p@2 \
      0+6px50+2p@2 100-5px50+2p@3 100-5px50@3
   #
   #################
   # What should be done after click on particular button
   #################
   #
   Mouse 0 1 N Menu WindowMenu
   Mouse 0 2 A Maximize 100 100
   Mouse 0 4 A Iconify
   Mouse 1 R A Menu FvwmMenuRoot
   Mouse 1 A M 	Move
   #Mouse 0 4 A   Thumbnail
   Mouse 2		R    	A       Menu WindowMenu Nop
   Mouse 3		R    	A      	WindowList
   #
   #################
   # setting Icons
   #################
   #
   SnapGrid 5
   BugOpts RaiseOverUnmanaged on
   EdgeScroll 0 0
   EdgeResistance 200 10000
   EdgeThickness 1
   Style ** Icon yax_default.xpm
   Style * IconBox 1000x150+240+0, IconGrid 1 1, IconFill Left Top
   Style * IconSize 90 70 -1 -1
   Style * IconBackgroundColorset 17
   Style * IconBackgroundRelief 2
   Style * IconBackgroundPadding 2
   #Style * IconSize 95 75 -1 -1
   Style * IconTitle, IndexedWindowName
   Style * WindowShadeSteps 0
   Style * IconFont "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"
   #
   #################
   # Icons applications
   #################
   #
   Style * IconOverride
   #Style * DecorateTransient
   Style xmmix Icon yax_audio.xpm
   Style uxterm Icon winterm.xpm
   Style xterm Icon winterm.xpm
   Style Adminterm Icon winterm.xpm
   Style Remote Icon yax_ssh.xpm
   Style iceweasel Icon Firefox.xpm
   Style *Thumbs* Icon fm.xpm
   Style *player* Icon yax_audio.xpm
   Style *XnView* Icon yax_view.xpm
   Style *Viewer* Icon yax_view.xpm
   Style xfontsel Icon font_select.xpm
   Style xmcalendar Icon calendar.xpm
   Style Calculator* Icon Xcalc.xpm
   Style gimp Icon yax_gfx.xpm
   Style gmemusage* Icon gmemusage.xpm
   Style Evince* Icon yax_view.xpm
   Style Xpdf Icon acroread.xpm
   Style Kopete Icon web_jump.xpm
   Style Totem Icon MPlayer.xpm
   Style mplayer Icon MPlayer.xpm
   Style NEdit Icon edit.xpm
   Style *FvwmPager Icon yax_pager.xpm
   Style xmag Icon distort.xpm
   #Style rox Icon ~/IconCatalog/ dirview.xpm
   Style rox Icon fm.xpm
   #
   # iconify and deiconify
   #
   AddToFunc DeiconifyAndRearrange
    + C Iconify off
    + C All (CurrentPage, Iconic) PlaceAgain Icon
   AddToFunc IconFunc
    + C DeiconifyAndRearrange
    + M Raise
    + M Move
    + D DeiconifyAndRearrange
   Mouse 1 I A DeiconifyAndRearrange
   #
   #################
   # root menu
   #################
   #
   *FvwmScript: DefaultFont  "-*-helvetica-bold-*-*-*-14-*-*-*-*-*-*-*"
   DestroyMenu "FvwmMenuRoot"
   AddToMenu "FvwmMenuRoot" "root Menu" Title
   + "Winterm" Exec exec uxterm
   + " E&xit 4Dwm " Popup FvwmExitFvwmPopup
   DestroyMenu "FvwmExitFvwmPopup"
   AddToMenu FvwmExitFvwmPopup "Exit 4Dwm?" Title
   + "&Restart"   Restart fvwm -f ~/.fvwm2rc
   + "&Quit"       FvwmForm FvwmForm-QuitVerify
   #
   #################
   # SGI window menu
   #################
   #
   DestroyMenu WindowMenu
   AddToMenu WindowMenu
   + " Window Options " Title
   + "&Iconify"      Iconify On
   + "R&aise"      Raise
   + "&Lower"      Lower
   + "&Stick"      Stick
   + "Shade"      WindowShade
   + "Ma&ximize"   Maximize 100 100
   + "Maximize &Horizontally"   Maximize 100 0
   + "Maximize &Vertically"   Maximize 0 100 
   + "I&dentify"    FvwmIdent
   + ""               Nop
   + "Kill Window"         Destroy
   + "Exit Window"      Delete
   #
   # Definition for  multiple desktop
   #
   DesktopSize 4x2
   DestroyModuleConfig FvwmPager: *
   *FvwmPager: Colorset * 1
   #*FvwmPager: HilightColorset * 4
   *FvwmPager: WindowColorsets 2 10
   *FvwmPager: Window3DBorders
   *FvwmPager: SmallFont none
   *FvwmPager: Hilight  #a59f80
   *FvwmPager: DeskHilight
   *FvwmPager: SolidSeparators
   *FvwmPager: BalloonFont "-*-helvetica-bold-*-*-*-14-*-*-*-*-*-*-*"
   *FvwmPager: Balloons All
   *FvwmPager: BalloonYOffset +2
   *FvwmPager: BalloonBorderWidth 1
   *FvwmPager: UseSkipList
   *FvwmPager: MoveThreshold 3
   *FvwmPager: BalloonStringFormat %c
   *FvwmPager: WindowBorderWidth 2
   *FvwmPager: NoMiniIcons
   *FvwmPager: Geometry 220x120-5-5
   *FvwmPager: NoDecor
   DestroyConfig FvwmBanner: *
   *FvwmBanner: NoDecor
   #*FvwmBanner: Pixmap /home/yaxkukmo/.fvwm/sgi_logo.xpm
   #####
   # Name:     Thumbnail
   # Purpose:  Iconify a window with a reduced screenshot of the application
   #           Window, looks really cool.
   #
   #+ I PipeRead "xwd -silent -id $[w.id] | convert -resize
   $[fvwm_icon_size] x $[fvwm_icon_image]> -border 1x1 -frame 1x1 \
   #
   ##################
   DestroyFunc Thumbnail
   AddToFunc Thumbnail
   + I Raise
   #+ I PipeRead "xwd -silent -id $[w.id] | convert -resize
   $[fvwm_icon_size] x $[fvwm_icon_image]! -border 1x1 -frame 1x1 \
   #    -mattecolor black -quality 0 xwd:-png:$[HOME]/.fvwm/icon.tmp.$[w.id].png \
   #    && echo WindowStyle IconOverride, Icon
   $[HOME]/.fvwm/icon.tmp.$[w.id].png, StaysOnBottom \
   #    || echo Nop"
   + I Iconify
   DestroyFunc DeThumbnail
   AddToFunc DeThumbnail
   + I DestroyWindowStyle
   + I Exec exec rm -f $HOME/.fvwm/icon.tmp.$[w.id].png
   # FIXME: This will destroy all Windowstyle settings.
   *FvwmEvent: deiconify DeThumbnail
   #
   #  Getting toolchest
   #
   Style Toolchest BorderWidth 2
   Style Toolchest BorderColorSet 13
   Style Toolchest HilightBorderColorSet 13
   Style * SloppyFocus
   DestroyMenu "ToolApps"
   AddToMenu "ToolApps"
   #+ "Dictionaries"    Popup ToolAppsDictionaries
   #+ "LaTeX2e"       Popup ToolAppsLatex
   + "Office"    Popup ToolAppsOffice
   + "Graphics"       Popup ToolAppsGraphics
   #+ "Multimedia"       Popup ToolAppsMultimedia
   #+ "Burn cd"      Exec exec k3b
   DestroyMenu "ToolAppsDictionaries"
   AddToMenu "ToolAppsDictionaries"
   + "Dictionary"    Exec exec stardict
   #+ "From polish to english"    Exec exec urxvt -n pol-eng -e sap -p
   #+ "From english to polish"    Exec exec urxvt -n eng-pol -e sap -a
   DestroyMenu "ToolAppsLatex"
   AddToMenu "ToolAppsLatex"
   + "Document Viewer"    Exec exec atril
   + "Pdf Viewer"    Exec exec xpdf
   DestroyMenu "ToolAppsOffice"
   AddToMenu "ToolAppsOffice"
   + "OpenOffice Word"    Exec exec lowriter
   + "OpenOffice Excel"    Exec exec localc
   + "OpenOffice PowerPoint"    Exec exec loimpres
   + "PDF Viewer"    Exec exec atril
   DestroyMenu "ToolAppsGraphics"
   AddToMenu "ToolAppsGraphics"
   + "The Gimp"    Exec exec gimp
   #+ "Inkscape"    Exec exec inkscape
   #+ "Dia"    Exec exec dia
   + "Picture Browser"    Exec exec geeqie
   DestroyMenu "ToolAppsMultimedia"
   AddToMenu "ToolAppsMultimedia"
   + "Picture Browser"    Exec exec geeqie
   #+ "Audio Player"    Exec exec beep-media-player
   #+ "Video Player"    Exec exec vlc
   DestroyMenu "ToolDesktop"
   AddToMenu "ToolDesktop"
   + "Customize"       Popup ToolCustomize
   + "Open Unix Shell"   Exec exec xterm -n Winterm -name Winterm -geometry 80x24
   + "Open Admin Shell"   Exec exec xterm -name Adminterm -geometry 80x24 -n Adminterm -bg \#440000 -e su -
   + "Open X Terminal Emulator"   Exec exec x-terminal-emulator
   + "File Manager"   Exec exec nautilus
   + ""          Nop
   #+ "Run Shadow Desktop"    Exec exec xcompmgr -c 1
   #+ "Stop Shadow Desktop" Exec exec killall xcompmgr
   + "Open 4Dwm Console"    Module FvwmConsole
   #+ "Lock Desktop"    Nop
   + ""          Nop
   #+ "Pager"          Module FvwmPager
   #+ "Go To Page 1"      GoToPage 0 0
   #+ "Go To Page 2"      GoToPage 1 0
   #+ ""          Nop
   + "Audio Events On"          Module FvwmEvent
   #+ "Control Audio"    Exec exec xmmix
   DestroyMenu "ToolCustomize"
   AddToMenu "ToolCustomize"
   + "Background Color"    Popup ToolDesktopBg
   + "Edit Config File"    Exec exec xterm -n Config -e vim ~/.fvwm/fvwmrc
   + "Edit StartUp File"    Exec exec xterm -n StartUp -e vim ~/.Xsession
   + "Edit XResources File" Exec exec xterm -n Xresources -e vim ~/.Xdefaults
   + "Apply XResources"    Exec exec xrdb ~/.Xdefaults
   DestroyMenu "ToolDesktopBg"
   AddToMenu "ToolDesktopBg"
   + "Indy"   Exec exec xsetroot -solid DodgerBlue3
   + "Crimson"   Exec exec xsetroot -solid SkyBlue4
   + "O2"      Exec exec xsetroot -solid SteelBlue4
   + "Indigo"   Exec exec xsetroot -solid RoyalBlue4
   + "Octane"   Exec exec xsetroot -solid DarkCyan
   + "Onyx"   Exec exec xsetroot -solid DarkSlateBlue
   + "Black"   Exec exec xsetroot -solid black
   DestroyMenu "ToolUtilities"
   AddToMenu "ToolUtilities"
   #+ "Search ..."   Exec exec gnome-search-tool
   + "Text Editor" Exec exec gvim
   #+ "Calendar"   Exec exec xcalendar
   + "Clipboard"   Exec exec xclipboard
   + "Font Viewer" Exec exec xfontsel
   + "Choose Window To Destroy" Exec exec xkill
   + "Magnify Part Of Desktop" Exec exec xmag
   DestroyMenu "ToolSystem"
   AddToMenu "ToolSystem"
   #+ "Hardware Info"      Exec exec urxvt -n Hinv -e sudo hinv
   #+ "System Monitor"   Exec exec gnome-system-monitor
   #+ "Disc Usage"      Exec exec baobab
   + "Console Process Monitor"      Exec exec xterm -n Top -e top
   + "Memory usage"   Exec exec xosview
   + "System Restart"   Nop
   + "System Halt"      Nop
   + "Log Out"      Nop
   DestroyMenu "ToolHelp"
   AddToMenu "ToolHelp"
   + "X Man Viewer"      Exec exec xman
   + "Debian GNU/Linux"      Exec exec firefox http://www.debian.org
   DestroyMenu "ToolInternet"
   AddToMenu "ToolInternet"
   + "Web Browser"      Exec exec firefox
   #+ "Internet Communicator"      Exec exec kopete
   #+ "Ftp client"      Exec exec urxvt -n Ftp -e lftp
   *Toolchest: Columns 1
   *Toolchest: Rows 6
   *Toolchest: BoxSize smart
   *Toolchest: Padding 11 0
   *Toolchest: Frame 1
   *Toolchest: Font "-*-helvetica-bold-*-*-*-14-*-*-*-*-*-*-*"
   *Toolchest: Colorset 11
   *Toolchest: ActiveColorset 8
   *Toolchest: ButtonGeometry 105x26+10+6
   *Toolchest: (Right, Icon toolIcon.xpm, Title (Side, Left) Desktop, Action (Mouse 1) \
      `Menu ToolDesktop rectangle $widthx$height+$left+$top +$widthp-5p +1p`)
   *Toolchest: (Right, Icon toolIcon.xpm, Title (Side, Left) Utilities, Action (Mouse 1) \
          `Menu ToolUtilities rectangle $widthx$height+$left+$top +$widthp-5p +1p`)
   *Toolchest: (Right, Title (Side, Left) Internet, Icon toolIcon.xpm Action (Mouse 1) \
          `Menu ToolInternet rectangle $widthx$height+$left+$top +$widthp-5p +1p`)
   *Toolchest: (Right, Title (Side, Left) System, Icon toolIcon.xpm, Action (Mouse 1) \
          `Menu ToolSystem rectangle $widthx$height+$left+$top +$widthp-5p +1p`)
   *Toolchest: (Right, Title (Side, Left) Apps, Icon toolIcon.xpm, Action (Mouse 1) \
          `Menu ToolApps rectangle $widthx$height+$left+$top  +$widthp-5p +1p`)
   *Toolchest: (Right, Title (Side, Left) Help, Icon toolIcon.xpm, Action (Mouse 1) \
          `Menu ToolHelp rectangle $widthx$height+$left+$top  +$widthp-5p +1p`)
   #
   # events
   #
   DestroyModuleConfig FvwmEvent: *
   # replace rplay by a sound player that can play .au sound file
   #*FvwmEvent: Cmd "Exec exec aplay "
   #*FvwmEvent: StartDelay 3
   #*FvwmEvent: Delay 1
   #*FvwmEvent: startup          "~/.fvwm/sounds/O2start.wav"
   #*FvwmEvent: add_window       "~/.fvwm/sounds/start-app.wav"
   #*FvwmEvent: destroy_window   "~/.fvwm/sounds/critical.wav"
   #*FvwmEvent: iconify          "~/.fvwm/sounds/open-win.wav"
   #*FvwmEvent: deiconify        "~/.fvwm/sounds/attention.wav"
   #*FvwmEvent: windowshade      "~/.fvwm/sounds/start-app.wav"
   #*FvwmEvent: dewindowshade    "~/.fvwm/sounds/attention.wav"
   #
   # start additional applications and fvwm modules
   #
   AddToFunc StartFunction
   #+ I Module FvwmEvent
   + I Module FvwmAuto 750
   + I Module FvwmButtons Toolchest
   + I Exec stalonetray &
   + I Exec mate-keyboard-properties &
   + I Exec redshift-gtk &
   + I Exec xsetroot -solid black &
   + I Exec nautilus --no-desktop &
   #+ I Module FvwmPager 0 0
   #+ I Test (init) Exec exec xtdesk
   #+ I Test (init) Exec exec rclock -geometry 170x175-5+5 -update 60 -fg black -bg \#a0a0a0
   + I Module FvwmPager
   #+ I Module FvwmBanner

##############################################################################
###########################################################################
# Now some keyboard shortcuts.

# Arrow Keys
# press arrow + control anywhere, and scroll by 1 page
Key Left	A	CM	Scroll -100 0
Key Right	A	CM	Scroll +100 +0
Key Up		A	CM	Scroll +0   -100
Key Down	A	CM	Scroll +0   +100

# press shift arrow + control anywhere, and move the pointer by 1% of a page
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

# press shift arrow + meta key, and move the pointer by 1/10 of a page
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

# press ctrl + meta + number key, and move the selected page
Key 1 A CM GotoPage 0 0
Key 2 A CM GotoPage 1 0
Key 3 A CM GotoPage 2 0
Key 4 A CM GotoPage 3 0
Key 5 A CM GotoPage 0 1
Key 6 A CM GotoPage 1 1
Key 7 A CM GotoPage 2 1
Key 8 A CM GotoPage 3 1

# Keyboard accelerators
Key F1		A	M	Raise
Key F2		A	M	Popup WindowMenu
#Key F3		A	M	Lower
Key F3		A	M	Move
Key F3		A	C	Resize
Key F4		A	M	Close
#Key Tab		A	M	CirculateUp
#Key Tab		A	SM	CirculateDown
###Key Tab A M WindowList "Prev FlipFocus" # Previous version
Key Tab A M Windowlist (CurrentPage) root c c CurrentDesk SelectOnRelease Alt_L NoHotkeys NoCurrentDeskTitle NoGeometry CurrentAtEnd
Key Escape A M Windowlist (CurrentPage) root c c CurrentDesk SelectOnRelease Alt_L NoHotkeys NoCurrentDeskTitle NoGeometry CurrentAtEnd
Key F7		A	M	Move
Key F8		A	M	Resize
Key F9		A	M	Iconify
Key F10		A	M	Maximize
#Key F11		A	N	WindowList 1
Key F12		A	N	WindowList 2
Key F12		A	M	WindowShade
Key m			A	M	Maximize 0 100
Key i			A	M	Iconify

Key	x			A	MC	exec xterm -bg black -fg wheat -geometry -0-0 -tn iris-ansi
Key	z			A	MC	exec xterm -bg black -fg wheat -geometry +0-0 -tn iris-ansi
#Key	x			A	MC	exec /usr/sbin/xwsh -noscrollbar -bg black -fg wheat -geometry 80x24-0-0 -title "Right Terminal"
#Key	z			A	MC	exec /usr/sbin/xwsh -noscrollbar -bg black -fg wheat -geometry 80x24+0-0 -title "Left Terminal"
Key	v			A	MC	exec gvim
Key	w			A	MC	exec firefox
#Key	s			A	MC	exec /usr/sbin/xwsh -title "Midnight Commander" -noscrollbar -e /usr/nekoware/bin/mc