# Menu with preferences
#
DestroyMenu /Preferences
AddToMenu /Preferences
+ '%22x22/fvwm-crystal/user-desktop.png%$[gt.Used recipe]'		Popup /Preferences/Recipes
+ '%22x22/fvwm-crystal/audio-x-generic.png%$[gt.Music player]'		Popup /Preferences/MusicPlayer
+ '%22x22/fvwm-crystal/multimedia-volume-control.png%$[gt.Audio mixer]'		Popup /Preferences/Mixer
+ '%22x22/fvwm-crystal/utilities-terminal.png%$[gt.Default terminal]'	Popup /Preferences/DefaultTerminal
+ '%22x22/fvwm-crystal/utilities-terminal.png%$[gt.QuakeConsole terminal]'	Popup /Preferences/QuakeConsoleTerminal
+ '%22x22/fvwm-crystal/system-file-manager.png%$[gt.Desktop manager]'	Popup /Preferences/DesktopManager
+ "" Nop
+ '$[gt.Window focus policy]'	Popup /Preferences/FocusPolicy
+ '$[gt.Privileged terminals]'	Popup /Preferences/PrivilegedTerminals

#
# Default terminal
#
DestroyMenu /Preferences/DefaultTerminal
AddToMenu /Preferences/DefaultTerminal
Test (x gnome-terminal) + '%22x22/apps/gnome-terminal.png%GNOME Terminal' SelectDefaultTerminal gnome-terminal
Test (x multi-gnome-terminal) + '%22x22/apps/multi-gnome-terminal.png%Multi GNOME Terminal' SelectDefaultTerminal multi-gnome-terminal
Test (x xfce4-terminal) + '%22x22/apps/xfce4-terminal.png%XFCE4 Terminal'	SelectDefaultTerminal xfce4-terminal
Test (x konsole) + '%22x22/apps/konsole.png%Konsole'	SelectDefaultTerminal konsole
Test (x Eterm) + '%22x22/apps/Eterm.png%Eterm'	SelectDefaultTerminal Eterm
Test (x mrxvt) + '%22x22/apps/mrxvt.png%MRxvt'	SelectDefaultTerminal mrxvt
Test (x urxvt) + '%22x22/apps/urxvt.png%URxvt'	SelectDefaultTerminal urxvt
Test (x aterm) + '%22x22/apps/aterm.png%Aterm'	SelectDefaultTerminal aterm
Test (x xterm) + '%22x22/apps/xterm.png%XTerm'	SelectDefaultTerminal xterm

DestroyFunc SelectDefaultTerminal
AddToFunc SelectDefaultTerminal
+ I FindCommand DefaultTerminal $0 urxvt Eterm aterm mrxvt xterm gnome-terminal konsole xfce4-terminal
+ I SavePreferences DefaultTerminal "FindCommand DefaultTerminal $0 urxvt Eterm aterm mrxvt xterm gnome-terminal konsole xfce4-terminal"

#
# QuakeConsole terminal
#
DestroyMenu /Preferences/QuakeConsoleTerminal
AddToMenu /Preferences/QuakeConsoleTerminal
Test (x mrxvt) + '%22x22/apps/mrxvt.png%MRxvt'	SelectQuakeConsoleTerminal mrxvt
Test (x urxvt) + '%22x22/apps/urxvt.png%URxvt'	SelectQuakeConsoleTerminal urxvt
Test (x aterm) + '%22x22/apps/aterm.png%Aterm'	SelectQuakeConsoleTerminal aterm
Test (x xterm) + '%22x22/apps/xterm.png%XTerm'	SelectQuakeConsoleTerminal xterm

DestroyFunc SelectQuakeConsoleTerminal
AddToFunc SelectQuakeConsoleTerminal
+ I FindCommand QuakeConsoleTerminal $0 mrxvt urxvt aterm xterm
+ I SavePreferences QuakeConsoleTerminal "FindCommand QuakeConsoleTerminal $0 mrxvt urxvt aterm xterm"

#
# Music player
#
DestroyMenu /Preferences/MusicPlayer
AddToMenu /Preferences/MusicPlayer
Test (x mpc)		+ '%22x22/apps/gmpc.png%MPD'		SelectMusicPlayer mpd
Test (x quodlibet)	+ '%22x22/apps/quodlibet.png%Quod Libet'	SelectMusicPlayer quodlibet
Test (x xmms-shell) 	+ '%22x22/apps/xmms.png%XMMS'	SelectMusicPlayer xmms
Test (x xmms2) 		+ '%22x22/apps/xmms2.png%XMMS2'	SelectMusicPlayer xmms2
Test (x cdcd) 		+ '%22x22/apps/goobox.png%cdcd'	SelectMusicPlayer cdcd

DestroyFunc SelectMusicPlayer
AddToFunc SelectMusicPlayer
+ I FindCommand MusicPlayer $0 mpd quodlibet xmms xmm2 cdcd
+ I Include components/functions/Music-$[MusicPlayer]
+ I SavePreferences DefaultMusicPlayer "Include components/functions/Music-$[MusicPlayer]"

#
# Audio mixer
#
DestroyMenu /Preferences/Mixer
AddToMenu /Preferences/Mixer
Test (x aumix) 		+ '%22x22/apps/aumix.png%Aumix'	SelectMixer aumix
			+ "" Nop
Test (x mpc)		+ '%22x22/apps/gmpc.png%MPD'		SelectMixer mpd
Test (x quodlibet)	+ '%22x22/apps/quodlibet.png%Quod Libet'	SelectMixer quodlibet
Test (x xmms-shell) 	+ '%22x22/apps/xmms.png%XMMS'	SelectMixer xmms
Test (x xmms2) 		+ '%22x22/apps/xmms2.png%XMMS2'	SelectMixer xmms2
Test (x cdcd) 		+ '%22x22/apps/goobox.png%cdcd'	SelectMixer cdcd

DestroyFunc SelectMixer
AddToFunc SelectMixer
+ I FindCommand DefaultMixer $0 aumix mpd quodlibet xmms xmms2 cdcd
+ I Include components/functions/Mixer-$[DefaultMixer]
+ I SavePreferences DefaultMixer "Include components/functions/Mixer-$[DefaultMixer]"

#
# Desktop manager
#
DestroyMenu /Preferences/DesktopManager
AddToMenu /Preferences/DesktopManager
+ '$[gt.None]' ActivateDesktopManager-None
+ "" Nop
Test (x rox) + '%22x22/apps/rox.png%ROX-Filer' ActivateDesktopManager-ROX
Test (x nautilus) + '%22x22/apps/nautilus.png%Nautilus' ActivateDesktopManager-Nautilus

DestroyFunc ActivateDesktopManager-None
AddToFunc ActivateDesktopManager-None
+ I SavePreferences DefaultDesktopManager "LoadPreferences LastChoosenWallpaper"
+ I Module FvwmForm DesktopManager-Dialog

DestroyFunc ActivateDesktopManager-ROX
AddToFunc ActivateDesktopManager-ROX
+ I SavePreferences DefaultDesktopManager "Include components/apps/ROX-Filer"
+ I Module FvwmForm DesktopManager-Dialog

DestroyFunc ActivateDesktopManager-Nautilus
AddToFunc ActivateDesktopManager-Nautilus
+ I SavePreferences DefaultDesktopManager "Include components/apps/Nautilus"
+ I Module FvwmForm DesktopManager-Dialog

All (DesktopManager-Dialog) Close
DestroyModuleConfig DesktopManager-Dialog: *
*DesktopManager-Dialog: Title "$[gt.Changed desktop manager]"
*DesktopManager-Dialog: Text "$[gt.Selected desktop manager will be used]"
*DesktopManager-Dialog: Line center
*DesktopManager-Dialog: Text "$[gt.at the next start of your X session]"
*DesktopManager-Dialog: Line center
*DesktopManager-Dialog: Line center
*DesktopManager-Dialog: Button quit " $[gt.Logout] " ^M
*DesktopManager-Dialog: Command Quit
*DesktopManager-Dialog: Button quit " $[gt.Not now] " ^[
*DesktopManager-Dialog: Command Nop
*DesktopManager-Dialog: Line center


#
# Window focus policy
#
DestroyMenu /Preferences/FocusPolicy
AddToMenu /Preferences/FocusPolicy
+ 'FVWM-Crystal'	ActivateFocusPolicy-FVWM-Crystal
+ 'FVWM-Crystal with raise'	ActivateFocusPolicy-FVWM-Crystal-Raise
+ 'MS Windows'		ActivateFocusPolicy-MSWindows

DestroyFunc ActivateFocusPolicy-FVWM-Crystal
AddToFunc ActivateFocusPolicy-FVWM-Crystal
+ I Include components/styles/FocusPolicy-FVWM-Crystal
+ I Include components/styles/FVWM
+ I Include components/styles/QuakeConsole
+ I Append components/styles/Applications
+ I SavePreferences DefaultFocusPolicy "Include components/styles/FocusPolicy-FVWM-Crystal"

DestroyFunc ActivateFocusPolicy-FVWM-Crystal-Raise
AddToFunc ActivateFocusPolicy-FVWM-Crystal-Raise
+ I Include components/styles/FocusPolicy-FVWM-Crystal-Raise
+ I Include components/styles/FVWM
+ I Include components/styles/QuakeConsole
+ I Append components/styles/Applications
+ I SavePreferences DefaultFocusPolicy "Include components/styles/FocusPolicy-FVWM-Crystal-Raise"

DestroyFunc ActivateFocusPolicy-MSWindows
AddToFunc ActivateFocusPolicy-MSWindows
+ I Include components/styles/FocusPolicy-MSWindows
+ I Include components/styles/FVWM
+ I Include components/styles/QuakeConsole
+ I Append components/styles/Applications
+ I SavePreferences DefaultFocusPolicy "Include components/styles/FocusPolicy-MSWindows"

#
# Privileged terminals
#
DestroyMenu /Preferences/PrivilegedTerminals
AddToMenu /Preferences/PrivilegedTerminals
+ '$[gt.On]'	SetPrivilegedTerminals
+ '$[gt.Off]'	UnsetPrivilegedTerminals

DestroyFunc SetPrivilegedTerminals
AddToFunc SetPrivilegedTerminals
+ I SavePreferences PrivilegedTerminals "Style XTerm FPOverrideGrabFocus"
+ I AppendPreferences PrivilegedTerminals "Style URxvt FPOverrideGrabFocus"
+ I AppendPreferences PrivilegedTerminals "Style Eterm FPOverrideGrabFocus"
+ I LoadPreferences PrivilegedTerminals

DestroyFunc UnsetPrivilegedTerminals
AddToFunc UnsetPrivilegedTerminals
+ I SavePreferences PrivilegedTerminals "Style XTerm !FPOverrideGrabFocus"
+ I AppendPreferences PrivilegedTerminals "Style URxvt !FPOverrideGrabFocus"
+ I AppendPreferences PrivilegedTerminals "Style Eterm !FPOverrideGrabFocus"
+ I LoadPreferences PrivilegedTerminals


#
# Recipes
#
DestroyMenu /Preferences/Recipes
AddToMenu /Preferences/Recipes
+ MissingSubmenuFunction Recipes-generator
+ '%22x22/categories/directory.png%$[gt.System]' Popup $[FVWM_SYSTEMDIR]/recipes
Test (f $[FVWM_USERDIR]/recipes) + '%22x22/categories/directory.png%$[gt.User]' Popup $[FVWM_USERDIR]/recipes

DestroyFunc Recipes-generator
AddToFunc Recipes-generator
+ I DestroyMenu recreate $0
+ I AddToMenu $0
+ I PipeRead 'for i in $0/*; do \
  name=$(basename "${i}"); \
  echo \"AddToMenu $0 \'${name}\' Recipe-Set \'${i}\'\"; done'

DestroyFunc Recipe-Set
AddToFunc Recipe-Set
+ I SavePreferences LastChoosenRecipe "Read \"$*\""
+ I Module FvwmForm Recipe-Restart-Dialog

All (Recipe-Restart-Dialog) Close
DestroyModuleConfig Recipe-Restart-Dialog: *
*Recipe-Restart-Dialog: Title "$[gt.Restart FVWM-Crystal]"
*Recipe-Restart-Dialog: Text "$[gt.New recipe will be used after next startup]"
*Recipe-Restart-Dialog: Line center
*Recipe-Restart-Dialog: Line center
*Recipe-Restart-Dialog: Button quit " $[gt.Restart] " ^M
*Recipe-Restart-Dialog: Command Restart
*Recipe-Restart-Dialog: Button quit " $[gt.Not now] " ^[
*Recipe-Restart-Dialog: Command Nop
*Recipe-Restart-Dialog: Line center

# vim:ft=fvwm
