# This work is licensed under the Creative Commons Attribution License
# To view a copy of this license, visit:
#    http://creativecommons.org/licenses/by/2.0/
#
# Lots of stuff in here came from Tavis Ormandy's config or was inspired by the
# content of his config.
# It can be found here: http://dev.gentoo.org/~taviso/fvwm2rc.html
#

SetEnv fvwm_dir $[HOME]/.fvwm
SetEnv script_dir $[fvwm_dir]/scripts
SetEnv bin_dir $[fvwm_dir]/bin
SetEnv fvwm_wallpaper_dir $[fvwm_dir]/images/backgrounds
SetEnv temp_icon_dir /dev/shm/fvwm-icons
SetEnv fvwm_wallpaper $[fvwm_wallpaper_dir]/Won-Ton-Soup-3.png

#Anything that is Execute'd will send stdout and stdout into the following file,
#set it to /dev/null to suppress output.
SetEnv debug_output_file /dev/null

SetEnv colorset_default 0
SetEnv colorset_inactive_windows 1
SetEnv colorset_active_windows 2
SetEnv colorset_inactive_menu 3
SetEnv colorset_active_menu 3
#SetEnv colorset_active_menu 4
SetEnv colorset_greyed_menus 5
SetEnv colorset_modules 6
SetEnv colorset_hilight 7
SetEnv colorset_icons 8

EdgeScroll 0 0
EdgeThickness 1
HideGeometryWindow
SnapAttraction 5 SameType Screen
DeskTopSize 6x1

# M O U S E  B i n d i n g s
# Clik the desktop for a menu
Mouse 1 R A ClickForMenu RootMenu
# Deiconify when clicking icons 
#   have to hold the win/apple key, I was accidentally
#   un-iconifying windows when my thumb hit the touchpad
Mouse 1 I 4 Iconify-or-not
# Display and options menu when clicking icons
Mouse 1 I N ClickForMenu DynamicWindowOpsMenu
# Move, raise, or lower when alt+clicking windows
Mouse 1 FSTW M Move-Raise-or-Lower
# Iconify on win/apple+click, resize on win/apple+click+drag
Mouse 1 FSTW 4 Thumbnail-or-Resize
# Window options when clicking the icon in the title bar
Mouse 1 1 A ClickForMenu DynamicWindowOpsMenu
# When the trackball is plugged in, use the scrollwheel to flip pages
#   but only when the mouse is over the pager
Mouse (FvwmPager) 4 W A GoToPage -1p +0p
Mouse (FvwmPager) 5 W A GoToPage +1p +0p

# K E Y  B i n d i n g s 
# use the help menu to get a description of the vailable key bindings
Key Left A M GoToPage -1p +0p
Key h A M GoToPage -1p +0p
Key Up A M GoToPage +0p -1p
Key k A M GoToPage +0p -1p
Key Down A M GoToPage +0p +1p
Key j A M GoToPage +0p +1p
Key Right A M GoToPage +1p +0p
Key l A M GoToPage +1p +0p

#this key doesn't seem to exist on the ibook, need to rebind it
Key Scroll_Lock A A Execute mpc status | head -n 1 | osd_cat -A center -p middle -f '-adobe-courier-bold-r-normal--34-240-100-100-m-200-iso8859-1' -c blue -u black -O 1 -s 1 -S black -d 2

Key l A 4 Focus-Next-Window
Key n A 4 Focus-Next-Window
Key h A 4 Focus-Prev-Window
Key p A 4 Focus-Prev-Window

Key l A 4M Focus-Next-Icon
Key h A 4M Focus-Prev-Icon

Key m A 4 maximize-window-and-toggle-title
Key m A M Thumbnail

Key x A 4 Close
Key BackSpace A 4 Destroy

Key Escape A 4 Popup RootMenu

Key M A CM Execute mpc pause
Key P A CM Execute mpc play
Key Right A CM Execute mpc next
Key Left A CM Execute mpc prev

Key L A CM  Execute xlock -mode matrix

Key S A 4 Resize Direction SouthEast
Key K A 4 Move

Key N A CM Execute xpad
Key R A CM Restart

Key h A C4 CursorMove -10p +0p
Key j A C4 CursorMove +0p +10p
Key k A C4 CursorMove +0p -10p
Key l A C4 CursorMove +10p +0p

# F U N C T I O N S
DestroyFunc StartFunction
AddToFunc StartFunction
+ I Module FvwmPager * *
+ I Module FvwmEvent
+ I Module FvwmButtons SmallPlayerPanel
+ I Module FvwmButtons FloatingDock
+ I Test (Init) SetupIconsDir
+ I Test (Init) Execute rm -rf $[temp_icon_dir]/*.png
+ I Test (Init) Execute fvwm-root --dither --retain-pixmap $[fvwm_wallpaper]
+ I Test (Init) Execute gdeskcal
+ I Test (Init) Execute xterm -bg black -fg white -e $[scripts_dir]/startup_tasks
+ I Test (Init) Execute cat .Xmodmap | xmodmap -
+ I Test (Init) Execute mpc load playlist
+ I Test (Init) Execute mpc random on
+ I Test (Init) SetEnv PATH $[script_dir]:$[bin_dir]:$[PATH]
+ I Read icons.fvwm2rc
+ I PipeRead help_builder
+ I ReThumbnail
+ I Module FvwmButtons FloatingDock

# This function is used any place where a program needs to be launched 
#   it captures stdout and stderr from the program in the $[debug_output_file]
DestroyFunc Execute
AddToFunc Execute
+ I Exec exec $* 2>&1 >> $[debug_output_file]

# This function is used to rearrange desktop icons
AddToFunc RearrangeIcons
+ I All (Iconic, CurrentPage) PlaceAgain icon

# This function initialzes the icon directory
DestroyFunc SetupIconsDir
AddToFunc SetupIconsDir
+ I PipeRead ' if [ ! -x $[temp_icon_dir] ]; then mkdir $[temp_icon_dir] ; fi'


DestroyFunc Focus-Prev-Window
AddToFunc Focus-Prev-Window
+ I Prev (AcceptsFocus !Iconic CurrentPage) Warp-Focus

DestroyFunc Focus-Next-Window
AddToFunc Focus-Next-Window
+ I Next (AcceptsFocus !Iconic CurrentPage) Warp-Focus

DestroyFunc Focus-Next-Icon
AddToFunc Focus-Next-Icon
+ I Next (Iconic CurrentPage) Warp-Focus

DestroyFunc Focus-Prev-Icon
AddToFunc Focus-Prev-Icon
+ I Next (Iconic CurrentPage) Warp-Focus

DestroyFunc Warp-Focus
AddToFunc Warp-Focus
+ I WarpToWindow
+ I Focus

#  Now only used when un-iconifying thumbnails
DestroyFunc Iconify-or-not
AddToFunc Iconify-or-not
+ H Nop
+ C Iconify

DestroyFunc maximize-window-and-toggle-title
AddToFunc maximize-window-and-toggle-title
+ I CustomMaximize
+ I ToggleTitle
DestroyFunc CustomMaximize
AddToFunc CustomMaximize
+ I ThisWindow (State 4) DoUnMaximize
+ I TestRc (NoMatch) DoMaximize

DestroyFunc DoMaximize
AddToFunc DoMaximize
+ I ResizeMoveMaximize 100 100 0 0
+ I State 4 True

DestroyFunc DoUnMaximize
AddToFunc DoUnMaximize
+ I Maximize off
+ I State 4 False

# not currently used
DestroyFunc WindowShade-or-Resize-or-not
AddToFunc WindowShade-or-Resize-or-not
+ H Nop
+ M Resize
+ C WindowShade

DestroyFunc Move-Raise-or-Lower
AddToFunc Move-Raise-or-Lower
+ M Move
+ C Raise
+ D Lower

DestroyFunc Thumbnail-or-Resize
AddToFunc Thumbnail-or-Resize
+ H Nop
+ M Resize
+ C Thumbnail

DestroyFunc Thumbnail
AddToFunc Thumbnail
+ I Raise
+ I ThisWindow (!Iconic) SetEnv Icon-$[w.id] $[w.iconfile]
+ I Test (f $[w.miniiconfile]) PipeRead \
    "thumbnail $[w.id] 128 $[temp_icon_dir]/icon.tmp.$[w.id].png $[w.miniiconfile]; \
    echo WindowStyle IconOverride, Icon $[temp_icon_dir]/icon.tmp.$[w.id].png ; \
    echo Nop"
+ I TestRc (NoMatch) PipeRead \
    "thumbnail $[w.id] 128 $[temp_icon_dir]/icon.tmp.$[w.id].png ; \
    echo WindowStyle IconOverride, Icon $[temp_icon_dir]/icon.tmp.$[w.id].png ; \
    echo Nop"
+ I Iconify

DestroyFunc DeThumbnail
AddToFunc DeThumbnail
+ I PipeRead "echo Test \\(i \\$\\[Icon-$w.id]\\]\\) WindowStyle Icon \\$\\[Icon-$[w.id]\\]"
+ I TestRc (NoMatch) WindowStyle NoIconOverride, Icon
+ I Execute rm -f $[temp_icon_dir]/icon.tmp.$[w.id].png
+ I RearrangeIcons
+ I UnsetEnv Icon-$[w.id]

DestroyFunc ReThumbnail
AddToFunc ReThumbnail
+ I All (iconic) WindowStyle IconOverride, Icon $[temp_icon_dir]/icon.tmp.$[w.id].png
+ I RearrangeIcons

DestroyFunc WallpaperChooser
AddToFunc WallpaperChooser I PipeRead 'test ! -d "$0/.thumbs" && mkdir "$0/.thumbs"; \
   for i in "$0/"*; do \
      test -f "$0/.thumbs/${i##*/}" \
         -a "${i}" -ot "$0/.thumbs/${i##*/}" || { \
            convert -quality 0 -scale 128 "${i}" "png:$0/.thumbs/${i##*/}" 2>/dev/null \
               || continue; \
         }; \
   done; '
+ I DestroyMenu $0
+ I AddToMenu $0 "Change Wallpaper" Title
+ I PipeRead 'for file in "$0/".thumbs/*; do \
      name=\`echo $file | rev | cut -f1 -d/ | rev \` ; \
      echo AddToMenu $0 "\*$0/.thumbs/$name*$name" Execute fvwm-root -r --dither $0/$name ;\
      done'

DestroyFunc NewWindowStuff
AddToFunc NewWindowStuff
+ I CheckPageBind

DestroyFunc ToggleTitle
AddToFunc ToggleTitle
+ I ThisWindow (State 3) TitleOn
+ I TestRc (NoMatch) TitleOff

DestroyFunc TitleOn
AddToFunc TitleOn
+ I WindowStyle !NoTitle
+ I State 3 False

DestroyFunc TitleOff
AddToFunc TitleOff
+ I WindowStyle NoTitle
+ I State 3 True

DestroyFunc SetPageBind
AddToFunc SetPageBind
+ I SetEnv BoundPageX $[page.nx]
+ I SetEnv BoundPageY $[page.ny]
+ I Setenv BoundDesk $[desk.n]
+ I Setenv BindNextWindow True
AddToFunc ClearPageBind
+ I SetEnv BindNextWindow False

DestroyFunc CheckPageBind
AddToFunc CheckPageBind
+ I Test ($[BindNextWindow]) PageBind
+ I SetEnv BindNextWindow False

DestroyFunc PageBind
AddToFunc PageBind
+ I MoveToPage $[BoundPageX] $[BoundPageY]
+ I MoveToDesk 0 $[BoundDesk]

DestroyFunc ClickForMenu
AddToFunc ClickForMenu
+ C Popup $0
+ H Popup $0
+ M Popup $0

# - = M O D U L E = -  C o n f i g u r a t i o n s
DestroyModuleConfig FvwmEvent: *
*FvwmEvent: deiconify DeThumbnail
*FvwmEvent: add_window NewWindowStuff

DestroyModuleConfig FvwmPager: *
*FvwmPager: Geometry 340x40-0+0
*FvwmPager: Rows 1, Columns 1
*FvwmPager: Font none
*FvwmPager: SmallFont "xft:Aquafont:size=6 Cyberbit:encoding=iso10646-1"
*FvwmPager: WindowLabelFormat "%t"
*FvwmPager: Balloons
*FvwmPager: BalloonFont "xft:Aquafont:size=12 Cyberbit:encoding=iso10646-1"
*FvwmPager: MiniIcons
*FvwmPager: WindowColors black #4A506A white #5A607A
*FvwmPager: Colorset * $[colorset_modules]
*FvwmPager: UseSkipList
Style FvwmPager Sticky, NoHandles, BorderWidth 1, NoTitle, WindowListSkip, NeverFocus, CirculateSkip

DestroyModuleConfig FloatingDock: *
*FloatingDock: Geometry 256x32-0-0
*FloatingDock: Rows 1
*FloatingDock: Frame 0
*FloatingDock: Colorset $[colorset_modules]
*FloatingDock: Padding 0 0
*FloatingDock: (1x1, Icon 32x32/term.png,  Action Execute xterm)
*FloatingDock: (1x1, PressIcon 32x32/grey-mozilla.png, ActiveIcon 32x32/purple-mozilla.png, Icon 32x32/mozilla.png, Action Execute firefox)
*FloatingDock: (1x1, Icon 32x32/gaim.png, ActiveIcon 32x32/gaim2.png, Action Execute gaim)
*FloatingDock: (1x1, Swallow (UseOld) "trayer" "Execute trayer --SetDockType true  --alpha 128 --transparent true --tint 0x4A506A --widthtype request")
#*FloatingDock: (2x1, Swallow (UseOld) "trayer" "Execute trayer --SetDockType true  --alpha 128 --transparent true --tint 0x4A506A --widthtype pixel --width 64")
*FloatingDock: (3x1, Swallow (UseOld) "FvwmApplet-DigitalClock" "FvwmScript $[script_dir]/FvwmApplet-DigitalClock $[colorset_modules]", Action Execute gdeskcal)
*FloatingDock: (1x1, Icon 32x32/nephros-lock.png, Action Execute xlock -mode matrix)
Style "*FloatingDock*" Sticky, NoHandles, BorderWidth 0, NoTitle, WindowListSkip, NeverFocus, CirculateSkip

DestroyModuleConfig SmallPlayerPanel: *
*SmallPlayerPanel: Colorset $[colorset_modules]
*SmallPlayerPanel: Fore #4A506A
*SmallPlayerPanel: Back #313431
*SmallPlayerPanel: Geometry 12x20-0+41
*SmallPlayerPanel: Rows 1
*SmallPlayerPanel: Frame 1
*SmallPlayerPanel: Padding 0 0
*SmallPlayerPanel: (Panel(left, steps 1, delay 0, position module top, indicator10) "PlayerPanel" 'Module FvwmButtons -transientpanel PlayerPanel')
Style SmallPlayerPanel NeverFocus, NoHandles, Sticky, BorderWidth 0, NoTitle, WindowListSkip, !Iconifiable, CirculateSkip

DestroyModuleConfig PlayerPanel: *
*PlayerPanel: Colorset $[colorset_modules]
*PlayerPanel: Frame 0
*PlayerPanel: Columns 5
*PlayerPanel: Rows 1
*PlayerPanel: "[<<]" None Execute mpc prev
*PlayerPanel: "[x]" None Execute mpc stop
*PlayerPanel: "[=]" None Execute mpc pause
*PlayerPanel: "[=>]" None Execute mpc play
*PlayerPanel: "[>>]" None Execute mpc next

*PlayerPanel: Geometry 322x18
Style PlayerPanel NeverFocus, NoHandles, Sticky, NoTitle, WindowListSkip, BorderWidth 0, CirculateSkip

DestroyModuleConfig ButtonsPanel:*
*ButtonsPanel: Colorset $[colorset_modules]
*ButtonsPanel: (Swallow FvwmIconMan "Module FvwmIconMan")
*ButtonsPanel: Geometry 928x39+12+0
Style ButtonsPanel NeverFocus, NoHandles, Sticky, NoTitle, WindowListSkip, BorderWidth 0, CirculateSkip

# - = S T Y L E = -  S e t t i n g s
ImagePath $HOME/.fvwm/images:$HOME/.fvwm/images/backgrounds:$HOME/.fvwm/images/icons:/usr/share/icons/gentoo/:/usr/share/icons/gentoo/32x32:/usr/share/icons/gentoo/l33t:/usr/share/icons/gentoo/64x64
DefaultFont "xft:Aquafont:size=12 Cyberbit:encoding=iso10646-1"
Colorset $[colorset_default] RootTransparent Buffer, Tint #4A516A 50, bg white, fg black, IconAlpha 50
Colorset $[colorset_inactive_windows] fg #4A506A, bg #4A506A
#bg black
Colorset $[colorset_active_windows] fg white, bg #4A506A
Colorset $[colorset_inactive_menu] fg white, bg black, Translucent #4A516A 90
#Colorset $[colorset_active_menu]  use inactive menu
#Colorset $[colorset_greyed_menus]  using nothing
Colorset $[colorset_modules] RootTransparent Buffer, Tint #4A516A 50, fg white, bg black
Colorset $[colorset_hilight] fg white, bg black, IconAlpha 100
Colorset $[colorset_icons] Transparent, fg white, bg black, fgAlpha 50
Colorset 9 HGradient 16 #4A506A #313431

Style MPlayer NoTitle
Style "xine Panel" NoTitle
Style gDeskCal NoTitle, WindowListSkip, NeverFocus
Style "*NoTitle*" NoTitle

Style * BorderWidth 1, NoHandles, SloppyFocus, EWMHMiniIconOverride, Colorset $[colorset_default], HilightBorderColorset $[colorset_inactive_windows], BorderColorset $[colorset_inactive_windows], IconTitleColorset $[colorset_icons], HilightIconTitleColorset $[colorset_hilight], IconTitleRelief 0, DecorateTransient, IconBox 1280x960-0-0, IconFill left bottom, IgnoreRestack, HilightFore white

Style FvwmPager NoTitle, Sticky, NeverFocus
Style *FvwmApplet-DigitalClock* NoTitle, BorderWidth 0, Sticky, NeverFocus, WindowListSkip
Style *FvwmApplet-SongTitle* NoTitle, BorderWidth 0, Sticky, NeverFocus, WindowListSkip
Style xbiff NoTitle, NoHandles, BorderWidth 0
MenuStyle * MenuColorset $[colorset_inactive_menu], ItemFormat "%s %i %| %l %|% %> ", \
         BorderWidth 1, Hilight3DThin, PopupOffset 0 100, PopupDelay 1000

TitleStyle LeftJustified
TitleStyle MultiPixmap Main Colorset 9, RightMain Colorset $[colorset_default], LeftMain Colorset $[colorset_default]
TitleStyle -- flat

ButtonStyle All (Colorset $[colorset_default] -- flat)
AddButtonStyle 1 MiniIcon (HiddenHandles NoInset Hilight3Doff -- flat)
AddButtonStyle 2 MiniIcon (HiddenHandles NoInset Hilight3Doff -- flat)

# C U R S O R S - to match the window decorations
CursorStyle title left_ptr #4A506A black
CursorStyle default left_ptr #4A506A black
CursorStyle top left_ptr #4A506A black
CursorStyle left left_ptr #4A506A black
CursorStyle right left_ptr #4A506A black
CursorStyle sys right_ptr #4A506A black
CursorStyle move fleur #4A506A black
CursorStyle resize sizing #4A506A black
CursorStyle wait watch #4A506A black
CursorStyle menu left_ptr #4A506A black
CursorStyle select crosshair #4A506A #313431
CursorStyle destroy pirate #4A506A #313431
CursorStyle root left_ptr #313431 #4A506A

#M E N U S
DestroyMenu RootMenu
AddToMenu RootMenu
+ "-= M E N U =- " Title
+ "%term.png%XTerm" Execute xterm -bg black -fg white
+ "%term.png%mrxvt" Execute mrxvt -t Terminal
+ "Console" Module FvwmConsole -g 40x10 -fg green -bg black
+ "Apps" Popup AppsMenu
+ "Documentation" Popup DocumentationMenu
+ "Systems" Popup SystemsMenu
+ "Scripts" Popup ScriptsMenu
+ "Status" Popup StatusMenu
+ "Help" Popup HelpMenu
+ "" Nop
+ "Settings" Popup SettingsMenu
+ "Restart" Restart
+ "Exit X" Quit
+ "" Nop
+ "%nephros-lock.png%LOCK TERMINAL" Execute xlock -mode matrix

DestroyMenu DocumentationMenu
AddToMenu DocumentationMenu
+ "Java Docs" Popup JavadocMenu

SetEnv javadocs $[HOME]/docs/api
DestroyMenu JavadocMenu
AddToMenu JavadocMenu
+ "Index" Execute xterm -e elinks $[javadocs]/index.html

AddToMenu MPDStatusMenu DynamicPopupAction MPDStatusFunc

DestroyFunc MPDStatusFunc
AddToFunc MPDStatusFunc
+ I DestroyMenu MPDStatusMenu
+ I AddToMenu MPDStatusMenu DynamicPopupAction MPDStatusFunc
# works for one line: + I PipeRead 'echo AddToMenu MPDStatusMenu \'"\'`mpc status | head -n 1`\'"\' Nop'
+ I PipeRead 'name="\`mpc status | head -n 1\`" ; \
              if [ "`echo $name | cut -f1 -d:`" == "volume" ]; then \
                line=stopped; \
              else \
                status=\`mpc status | head -n 2 | tail -n 1 | cut -f2 -d\[ | cut -f1 -d\]\`; \
                line="\[$status\] $name"; \
              fi ; \
              echo AddToMenu MPDStatusMenu \'"\'"$line"\'"\' Nop'

DestroyMenu StatusMenu
AddToMenu StatusMenu
# what kind of status stuff is appropriate?
+ "Media" Title
+ "Volume" Popup VolumeMenu
+ "MPD - What's playing?" Popup MPDStatusMenu

AddToMenu VolumeMenu DynamicPopupAction VolumeFunc
DestroyFunc VolumeFunc
AddToFunc VolumeFunc
+ I DestroyMenu VolumeMenu
+ I AddToMenu VolumeMenu DynamicPopupAction VolumeFunc
+ I PipeRead 'volume_meter VolumeMenu'

DestroyMenu ScriptsMenu
AddToMenu ScriptsMenu
+ "Fvwm Scripts" Popup FvwmScripts
+ "Other Scripts" Popup OtherScripts

DestroyMenu FvwmScripts
AddToMenu FvwmScripts
+ "Bell Setup" FvwmScript FvwmScript-BellSetup
+ "Clock" FvwmScript $[HOME]/bin/FvwmApplet-DigitalClock 1
+ "Date/Time" FvwmScript FvwmScript-Date
+ "File Browser" FvwmScript FvwmScript-FileBrowser
+ "Find" FvwmScript FvwmScript-Find
+ "Keyboard Setup" FvwmScript FvwmScript-KeyboardSetup
+ "Mouse Setup" FvwmScript FvwmScript-PointerSetup
+ "" Nop
+ "Logoff Dialog" FvwmScript FvwmScript-Quit

DestroyMenu WeatherMenu
AddToMenu WeatherMenu DynamicPopupAction RebuildWeatherFunc

DestroyMenu OtherScripts
AddToMenu OtherScripts
+ "Bookmarks" Popup ffBookmarksMenu
+ "Weather" Popup WeatherMenu
+ "News" Popup NewsMenu

DestroyMenu NewsMenu
AddToMenu NewsMenu
+ MissingSubmenuFunction NewsFunc
+ "Slashdot" Popup slashdot
+ "Linux Today" Popup linuxtoday
+ "" Nop
+ "Reset News" ResetNewsFunc

DestroyMenu AppsMenu
AddToMenu AppsMenu
+ "Devel" Popup DevelMenu
+ "Net" Popup NetMenu
+ "Media" Popup MediaMenu
+ "" Nop
+ "xosview" Execute xosview

DestroyMenu DevelMenu
AddToMenu DevelMenu
+ "%dia.png%Dia" Execute dia
+ "%vim.png%Vim" Execute xterm -T vim -e vim

DestroyMenu MediaMenu
AddToMenu MediaMenu
+ "%mplayer.png%Media Player" Execute gmplayer
+ "%rhythmbox.png%Glurp" Execute glurp
+ "%gimp.png%Gimp" Execute gimp
+ "%abiword.png%AbiWord" Execute abiword
+ "%openoffice.png%Office" Execute ooffice
+ "%xine.png%Xine" Execute xine

DestroyMenu NetMenu
AddToMenu NetMenu
+ "%mozilla.png%Firefox" Execute firefox
+ "%gaim.png%Gaim" Execute gaim
+ "%xchat.png%XChat" Execute xchat-2

DestroyMenu SettingsMenu
AddToMenu SettingsMenu
+ MissingSubmenuFunction WallpaperChooser
+ "Change Wallpaper" Popup $[fvwm_wallpaper_dir]
+ "Gtk Theme" Execute switch2
+ "%sndvol.png%Volume" Execute aumix

DestroyMenu SystemsMenu
AddToMenu SystemsMenu
+ "%earth.png%Earth" Execute aterm -T EARTH -bg black -fg white -trsb -pixmap ~/.fvwm/images/aterms/earth.xpm -e ssh dennisos@earth
+ "%earth.png%Earth (With X11 Forwarding)" Execute aterm -T EARTH-X -bg black -fg white -trsb -pixmap ~/.fvwm/images/aterms/earth.xpm -e ssh -X -Y dennisos@earth
+ "Fang" Execute xterm -e ssh -X -Y denniss@fang.cs.sunyit.edu
+ "Demeter" Execute xterm -e ssh -X -Y denniss@demeter.sunyit.edu

DestroyMenu HelpMenu
AddToMenu HelpMenu
+ "Key Bindings" Popup KeybindingsMenu
+ "Mouse Bindings" Popup MousebindingsMenu
+ "Man Pages" Popup HelpMan

DestroyMenu MousebindingsMenu
AddToMenu MousebindingsMenu
+ "On the Desktop" Title
+ "Left-Click: Menu" Nop
+ "Middle-Click: Xterm" Nop
+ "Right-Click: Window Options" Nop
+ "Iconified Windows" Title
+ "Left-Click: Uniconify" Nop
+ "Right-Click: Window Options" Nop
+ "Windows" Title
+ "Alt + Left-Click: Move/Raise/Lower Window" Nop
+ "Alt + Middle-Click: (Un)Iconify" Nop
+ "Alt + Right-Click: Resize" Nop
+ "Win + Middle-Click: Window Options" Nop

DestroyMenu KeybindingsMenu
AddToMenu KeybindingsMenu
+ "Navigation" Title
+ "Alt + Left: Left one Page" Nop
+ "Alt + H: Left one Page" Nop
+ "Alt + Up: Up one Page" Nop
+ "Alt + K: Up one Page" Nop
+ "Alt + Down: Down one Page" Nop
+ "Alt + J: Down one Page" Nop
+ "Alt + Right: Right one Page" Nop
+ "Alt + L: Right one Page" Nop
+ "Win + L: Focus Next Window" Nop
+ "Win + N: Focus Next Window" Nop
+ "Win + H: Focus Prev Window" Nop
+ "Win + P: Focus Prev Window" Nop
+ "Win + Alt + L: Focus Next Icon" Nop
+ "Win + Alt + H: Focus Prev Icon" Nop
+ "Control" Nop
+ "Win + M: Maximize" Nop
+ "Alt + M: Iconify" Nop
+ "Win + K: Move Current Window" Nop
+ "Win + S: Resize Current Window" Nop
+ "Win + X: Close Current Window" Nop
+ "Win + Backspace: Destroy Current Window" Nop
+ "Media Controls" Title
+ "Ctrl + Alt + M: Pause Song" Nop
+ "Ctrl + Alt + P: Play Song" Nop
+ "Ctrl + Alt + Right: Skip Song" Nop
+ "Ctrl + Alt + Left: Quit Player" Nop
+ "Scroll Lock: Display Current Song Title" Nop
+ "Other" Title
+ "Win + Escape: Display Root Menu" Nop
+ "Ctrl + Alt + N: Open Notes" Nop
+ "Ctrl + Alt + L: Screen Lock" Nop
+ "Win + Tab: Window List" Nop
+ "Ctrl + Alt + R: Restart Window Manager" Nop

# U N S O R T E D - scripty menus and such

# This is the context-sensitive options menu
DestroyMenu DynamicWindowOpsMenu
AddToMenu DynamicWindowOpsMenu DynamicPopupAction DynamicWindowOpsMenuFunction

# This function populates the content of the news menus
DestroyFunc NewsFunc
AddToFunc NewsFunc
+ I Piperead 'fvwm-menu-headlines -command \'Function Execute firefox -remote "openurl(%u,new-tab)"\' --site $0'
+ I Schedule 1800000 DestroyMenu $0

# This function resets the menu content of news menus
DestroyFunc ResetNewsFunc
AddToFunc ResetNewsFunc
+ I DestroyMenu linuxtoday

# This function populates the firefox bookmarks menu
DestroyFunc ffBookmarksFunc
AddToFunc ffBookmarksFunc
+ I PipeRead 'firefox_bookmarks ffBookmarksMenu ffBookmarksFunc'

# This menu is for firefox bookmarks
DestroyMenu ffBookmarksMenu
AddToMenu ffBookmarksMenu DynamicPopupAction ffBookmarksFunc

# This is the function for creating context-sensitive menus
DestroyFunc DynamicWindowOpsMenuFunction
AddToFunc DynamicWindowOpsMenuFunction
+ I DestroyMenu recreate DynamicWindowOpsMenu
+ I AddToMenu DynamicWindowOpsMenu "Window Options: $[w.name]" Title
+ I ThisWindow (Iconic) AddToMenu DynamicWindowOpsMenu "Deiconify" Iconify
+ I ThisWindow ("Firefox-bin" !Iconic) AddToMenu DynamicWindowOpsMenu "New Tab" Execute firefox -remote "openurl(about:blank,new-tab)"
+ I ThisWindow ("Firefox-bin") AddToMenu DynamicWindowOpsMenu "New Window" Execute firefox -remote "openurl(about:blank,new-window)"
+ I ThisWindow ("Firefox-bin") AddToMenu DynamicWindowOpsMenu "Bookmarks" Popup ffBookmarksMenu
+ I AddToMenu DynamicWindowOpsMenu "" Nop
+ I AddToMenu DynamicWindowOpsMenu "Identify" FvwmIdent
+ I ThisWindow (!Iconic) AddToMenu DynamicWindowOpsMenu "Get Screenshot" Screenshot $[w.id]
+ I AddToMenu DynamicWindowOpsMenu "" Nop
+ I AddToMenu DynamicWindowOpsMenu "Move" Move
+ I AddToMenu DynamicWindowOpsMenu "Resize" Resize
+ I ThisWindow (!Maximized) AddToMenu DynamicWindowOpsMenu "Maximize" Maximize
+ I ThisWindow (Maximized) AddToMenu DynamicWindowOpsMenu "Un-Maximize" Maximize
+ I ThisWindow (!Shaded) AddToMenu DynamicWindowOpsMenu "Shade" WindowShade
+ I ThisWindow (Shaded) AddToMenu DynamicWindowOpsMenu "Un-Shade" WindowShade false
+ I ThisWindow (!Iconic) AddToMenu DynamicWindowOpsMenu "Iconify" Thumbnail
+ I ThisWindow (Sticky) AddToMenu DynamicWindowOpsMenu "Un-Stick" WindowStyle !Sticky
+ I ThisWindow (!Sticky) AddToMenu DynamicWindowOpsMenu "Make Sticky" WindowStyle Sticky
+ I ThisWindow (!Iconic) AddToMenu DynamicWindowOpsMenu "Toggle Title" ToggleTitle
+ I AddToMenu DynamicWindowOpsMenu "" Nop
+ I AddToMenu DynamicWindowOpsMenu "Bind Next Window" SetPageBind
+ I AddToMenu DynamicWindowOpsMenu "Cancel Bind Next" ClearPageBind
+ I AddToMenu DynamicWindowOpsMenu "Un-Bind Window" Nop
+ I AddToMenu DynamicWindowOpsMenu "" Nop
+ I AddToMenu DynamicWindowOpsMenu "Close" Close
+ I AddToMenu DynamicWindowOpsMenu "Kill" Destroy
+ I AddToMenu DynamicWindowOpsMenu "" Nop
+ I AddToMenu DynamicWindowOpsMenu "Group Actions" Popup DynamicGroupMenuThingy

# This is a function to take screen shots and caps of individual windows
DestroyFunc Screenshot
AddToFunc Screenshot
+ I Execute $[script_dir]/screenshot $0

# This is the context-sensitive group menu 
DestroyMenu DynamicGroupMenuThingy
AddToMenu DynamicGroupMenuThingy DynamicPopupAction DynamicGroupMenuThingyFunction

# This creates a context menu for windows based on group (window class)
DestroyFunc DynamicGroupMenuThingyFunction
AddToFunc DynamicGroupMenuThingyFunction
+ I DestroyMenu recreate DynamicGroupMenuThingy
+ I AddToMenu DynamicGroupMenuThingy "Group: $[w.class]" Nop
+ I Current + "Close All" Current All ($[w.class]) Close
+ I Current + "Shade All" Current All ($[w.class], !Shaded) WindowShade True
+ I Current + "Iconfiy All" Current All ($[w.class], !Iconic) Thumbnail
+ I Current + "List" Popup QuickWindowList

# This is used to build the List option of the group context-menu
DestroyMenu QuickWindowList
AddToMenu QuickWindowList DynamicPopupAction DynamicQuickWindowListFunction QuickWindowList

# This creates a window list similar to the NewAltTabFunction, but is used within the group context menu
DestroyFunc DynamicQuickWindowListFunction
AddToFunc DynamicQuickWindowListFunction
+ I DestroyMenu recreate QuickWindowList
+ I AddToMenu QuickWindowList "Desk: $[desk.n]" Title
+ I Current All ($[w.class], CirculateHit, !Iconic, AcceptsFocus) EvalQuickWindowList QuickWindowList
+ I AddToMenu QuickWindowList "Desk: $[desk.n] (iconic)" Title
+ I Current All ($[w.class], CirculateHit, Iconic, AcceptsFocus) EvalQuickWindowListIcons QuickWindowList

# This builds a weather menu that displays the 5-day forecast
DestroyFunc RebuildWeatherFunc
AddToFunc RebuildWeatherFunc
+ I DestroyMenu recreate WeatherMenu
+ I PipeRead '$[script_dir]/weather/weather_script.sh WeatherMenu'

# Binds the NewAltTabFunction to the key Win+Tab
Key Tab A 4 Menu NewAltTabMenu Root 25 25
DestroyMenu NewAltTabMenu
AddToMenu NewAltTabMenu DynamicPopupAction NewAltTabFunction

# This creates an alt-tab like menu, but it lists the non-iconified windows and then iconified windows -
# the iconified windows have their thumbnails displayed, non-iconified display mini-icons
DestroyFunc NewAltTabFunction
AddToFunc NewAltTabFunction
+ I DestroyMenu NewAltTabMenu
+ I AddToMenu NewAltTabMenu DynamicPopupAction NewAltTabFunction
+ I Current All ( !"Fvwm*", !Iconic, AcceptsFocus ) EvalQuickWindowList NewAltTabMenu
+ I Current All ( !"Fvwm*", Iconic, AcceptsFocus ) EvalQuickWindowListIcons NewAltTabMenu

# Used to create a menu of non-iconified windows
DestroyFunc EvalQuickWindowList
AddToFunc EvalQuickWindowList
+ I Current AddToMenu $0 %$[w.miniiconfile]%"$[w.class]: $[w.name]" WindowId $[w.id] Warp-Focus

# Used to create a menu of the iconified windows
DestroyFunc EvalQuickWindowListIcons
AddToFunc EvalQuickWindowListIcons
+ I Current AddToMenu $0 %$[temp_icon_dir]/icon.tmp.$[w.id].png%"$[w.class]: $[w.name]" WindowId $[w.id] WindowListSelectFunction

# Used to un-iconify windows in the group context menu
DestroyFunc WindowListSelectFunction
AddToFunc WindowListSelectFunction
+ I Iconify
+ I Warp-Focus