# Corner desktop (former "devel")
# Written by: Maciej Delmanowski <harnir@post.pl>
#
# 2007-2013: Dominique Michel <dominique_libre@users.sourceforge.net>
# See ChangeLog for details
#
# You can use folding to navigate this file

Echo Corner recipe loading from $.

# ImagePath {{{1
InfoStoreAdd Icon_Theme "Default"
ImagePath $FVWM_USERDIR/icons/$[infostore.Icon_Theme]:$FVWM_SYSTEMDIR/icons/$[infostore.Icon_Theme]

# Includes and FVWM modules {{{1
Module FvwmCommandS

# Default FVWM-Crystal functions, initialization {{{2
Include components/functions/Clear-FVWM-Settings
Include components/desktop/FVWM-Crystal_Functions
Include components/desktop/FVWM-Crystal_Preferences
Include components/functions/Fullscreen
Append preferences/Startup

# Preferred applications {{{2
Include components/functions/Screenshot-import
Include components/apps/XScreenSaver
Include components/apps/FvwmMiniConsole
Include components/apps/QuakeConsole
Include components/apps/OpenOffice.org
Include components/functions/NotificationAreaManager-$[infostore.NotificationAreaManager]
Include preferences/NotificationArea-Width
Include components/functions/Xephyr

# Desktop & window bindings {{{2
Include components/bindings/Desktop-RMB-OpenTerminal
Include components/bindings/Desktop-MMB-EdgeScroll
Include components/bindings/Desktop-MMB-TogglePanels
Include components/bindings/Window-Basic
Include components/bindings/Window-Border
Include components/bindings/Window-Transparency

# Keyboard bindings {{{2
Include components/desktop/Keyboard
Include components/desktop/Keyboard_NumLock
Include components/desktop/Numpad

# Multimedia bindings {{{2
Include components/bindings/Multimedia_Keys
Include components/bindings/Multimedia_Keys_NumLock

# Various styles {{{2
Include components/desktop/FVWM-Crystal_Styles
Include components/styles/CursorStyle-Border

# Use window thumbnails instead of simple icons on the desktop {{{2
Include components/desktop/Icon-Thumbnails

# Desktop manager
LoadPreferences DefaultDesktopManager

# Must be after the styles
Include components/functions/Music-$[infostore.MusicPlayer]


# pager's dimension {{{1
InfoStoreAdd Desk_Pages_X "8"
InfoStoreAdd Desk_Pages_Y "1"
DesktopSize $[infostore.Desk_Pages_X]x$[infostore.Desk_Pages_Y]

# Desktop settings {{{1
EdgeScroll	0	0
EdgeResistance			0
Style * EdgeMoveDelay		250
Style * EdgeMoveResistance	100
HideGeometryWindow	Move, Resize
OpaqueMoveSize	100
EdgeThickness	1
EWMH-Desktop 3 3 3 3
EWMH-Panel-Right 30

# Pager {{{1
All (FvwmPager) Close
DestroyModuleConfig FvwmPager: *
PipeRead 'echo *FvwmPager: Geometry $((28*$[infostore.Desk_Pages_X]))x24-+1+1'
*FvwmPager: Rows   1
*FvwmPager: MiniIcons
*FvwmPager: Font none
*FvwmPager: WindowBorderWidth 1
*FvwmPager: Window3DBorders
#*FvwmPager: NoSeparators
*FvwmPager: UseSkipList
*FvwmPager: Colorset * $[infostore.cs_panel_inactive]
*FvwmPager: HilightColorset * $[infostore.cs_panel_active]
*FvwmPager: WindowColorsets $[infostore.cs_panel_wininactive] $[infostore.cs_panel_winactive]

Module FvwmPager
#*FvwmButtons-Pager: (Swallow (Close, FvwmModule) "FvwmPager" 'Module FvwmPager')
#Module FvwmButtons FvwmButtons-Pager

# Main menu panel {{{1
All (FvwmButtons-Panel) Close
DestroyModuleConfig FvwmButtons-Panel: *
*FvwmButtons-Panel: Geometry --1+49
*FvwmButtons-Panel: BoxSize smart
*FvwmButtons-Panel: ActiveColorset $[infostore.cs_panel_active]
*FvwmButtons-Panel: Colorset $[infostore.cs_panel_inactive]
*FvwmButtons-Panel: Columns 1
*FvwmButtons-Panel: Padding 1 1
*FvwmButtons-Panel: Frame 0
*FvwmButtons-Panel: Font "xft:$[panel_font]:pixelsize=$[panel_font_size]:$[panel_font_style]"

# diamond {{{2
*FvwmButtons-Panel: (1x1, Size 22 22, Icon "22x22/fvwm-crystal/fvwm-crystal.png", \
	Action (Mouse 1) Menu /FVWM-Crystal $[MenuPosition_WS], \
	Action (Mouse 3) Wallpaper-Random $[FVWM_SYSTEMDIR]/wallpapers $[FVWM_USERDIR]/wallpapers ~/wallpapers /usr/local/share/wallpapers /usr/share/wallpapers) \
  	Action (Mouse 4) X videomodeswitch+, \
  	Action (Mouse 5) X videomodeswitch-)

# Main "diamond" menu {{{2
DestroyMenu /FVWM-Crystal
AddToMenu /FVWM-Crystal
+ '%22x22/fvwm-crystal/preferences-desktop-screensaver.png%$[gt.Screensaver]' Popup /Screensaver
+ '%22x22/fvwm-crystal/camera-photo.png%$[gt.Screenshot]' Popup /Screenshot
+ "" Nop
+ '%22x22/fvwm-crystal/preferences-desktop-theme.png%$[gt.Window decorations]' Popup /Window-Decorations
+ '%22x22/fvwm-crystal/colorsets.png%$[gt.Colorsets]' Popup /Colorsets
+ '%22x22/fvwm-crystal/preferences-desktop-wallpaper.png%$[gt.Wallpaper]' Popup /Wallpaper
+ '%22x22/fvwm-crystal/preferences-desktop.png%$[gt.Preferences]' Popup /Preferences
+ "" Nop
+ '%22x22/fvwm-crystal/applications-development.png%$[gt.Developer menu]' Popup /Developer
+ '%22x22/fvwm-crystal/fvwm-crystal.png%$[gt.About FVWM-Crystal]' Include components/functions/About
+ MissingSubmenuFunction FuncFvwmMenuXephyrDirectory
+ '%22x22/fvwm-crystal/gdm-xnest.png%$[gt.Nested sessions]' Popup /etc/X11/Sessions
+ '%22x22/fvwm-crystal/system-log-out.png%$[gt.Exit]' Popup /Exit

*FvwmButtons-Panel: (1x1, Icon "22x22/fvwm-crystal/window-list.png", \
Action (Mouse 1) Window-List "$[MenuPosition_WS]", \
Action (Mouse 2) All (CurrentPage) PlaceAgain anim, \
Action (Mouse 3) Window-List-Icons "$[MenuPosition_WS]")

Module FvwmButtons FvwmButtons-Panel

# Musicpanel {{{1
All (FvwmButtons-Music) Close
DestroyModuleConfig FvwmButtons-Music: *
*FvwmButtons-Music: Geometry --1+98
*FvwmButtons-Music: BoxSize smart
*FvwmButtons-Music: ActiveColorset $[infostore.cs_panel_active]
*FvwmButtons-Music: Colorset $[infostore.cs_panel_inactive]
*FvwmButtons-Music: Columns 1
*FvwmButtons-Music: Padding 1 1
*FvwmButtons-Music: Frame 0
*FvwmButtons-Music: Font "xft:$[panel_font]:pixelsize=$[panel_font_size]:$[panel_font_style]"

# Main music button 1, with main menus and controls {{{2
*FvwmButtons-Music: (1x1, Size 22 22, Icon "22x22/categories/Multimedia.png", \
	Action (Mouse 1) Menu /Player $[MenuPosition_WS], \
	Action (Mouse 2) Music-GUI, \
	Action (Mouse 3) Music-QJackGUI, \
	Action (Mouse 4) Mixer-Volume-Up $[infostore.Vol_Step], \
	Action (Mouse 5) Mixer-Volume-Down $[infostore.Vol_Step])
# music controls button 2 {{{2
*FvwmButtons-Music: (1x1, Size 22 22, Icon "22x22/fvwm-crystal/media-eject.png", \
	Action (Mouse 1) Menu /Playlist-button $[MenuPosition_WS], \
	Action (Mouse 2) Menu /Music/Volume $[MenuPosition_WS], \
	Action (Mouse 3) Menu /Mixer $[MenuPosition_WS], \
	Action (Mouse 4) Music-Next, \
	Action (Mouse 5) Music-Prev)
# music controls button 3 {{{2
*FvwmButtons-Music: (1x1, Size 22 22, Icon "22x22/fvwm-crystal/media-playback-start.png", \
        Action (Mouse 1) Music-Play, \
        Action (Mouse 2) Music-Pause, \
        Action (Mouse 3) Menu /Playback $[MenuPosition_WS], \
	Action (Mouse 4) Music-Speed-Up, \
	Action (Mouse 5) Music-Speed-Down)
# music controls button 4 {{{2
*FvwmButtons-Music: (1x1, Size 22 22, Icon "22x22/fvwm-crystal/media-skip-forward.png", \
	Action (Mouse 1) Menu /Speed $[MenuPosition_WS], \
	Action (Mouse 4) Button-Seek-+, \
	Action (Mouse 5) Button-Seek--)
# }}}2

Module FvwmButtons FvwmButtons-Music

# Applications menu generator {{{1
PipeRead 'fvwm-crystal.apps --database=$[FVWM_DISTROMENUDIR]/Applications --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --search-icons-in=$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/32x32/categories:$[FVWM_USERDIR]/icons/$[infostore.Icon_Theme]/32x32/apps:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/32x32/categories:$[FVWM_SYSTEMDIR]/icons/$[infostore.Icon_Theme]/32x32/apps:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/32x32/categories:$[FVWM_DISTROMENUDIR]/icons/$[infostore.Icon_Theme]/32x32/apps --default-file-icon=32x32/apps/default.png --default-dir-icon=32x32/categories/directory.png --min-submenu-length=5 --sort=prio --no-panel --check-execs'

# A small workaround made to allow desktop click which close program's menu
# and don't open main FVWM-Crystal menu at the same time (usually it's made
# using LMB). Hold LMB on the desktop to open the Applications menu
DestroyFunc DesktopMenu
AddToFunc DesktopMenu
+ H Menu /Applications $[MenuPosition_BelowLeft]

Mouse 1 R $[Mod] DesktopMenu

# Clock {{{1
All (FvwmButtons-Clock) Close
DestroyModuleConfig FvwmButtons-Clock: *
#*FvwmButtons-Clock: Geometry --1+624
*FvwmButtons-Clock: Geometry --1+24
*FvwmButtons-Clock: BoxSize smart
*FvwmButtons-Clock: ActiveColorset $[infostore.cs_panel_active]
*FvwmButtons-Clock: Colorset $[infostore.cs_panel_inactive]
*FvwmButtons-Clock: Columns 2
*FvwmButtons-Clock: Padding 2 2
*FvwmButtons-Clock: Frame 0
*FvwmButtons-Clock: Font "xft:$[panel_font]:pixelsize=$[panel_font_size]:$[panel_font_style]"

*FvwmButtons-Clock: (2x1, Size 60 24, \
Swallow (Close, Respawn, FvwmModule) "FvwmScript-Clock" 'Script components/scripts/FvwmScript-Clock', \
Action (Mouse 3) SendToModule *FvwmScript-Clock SendString 1 1 str)

Module FvwmButtons FvwmButtons-Clock

# Change desktop pages using mouse wheel on pager
Mouse (FvwmPager) 4 W $[Mod] GotoPage-Right
Mouse (FvwmPager) 5 W $[Mod] GotoPage-Left

# Settings for icons on the desktop {{{1
Style * IconBox 1200x800+30-30, IconFill left bottom, IconGrid 30 30
Style * StickyIcon

# Notification Area {{{1
# Settings of stalonetray {{{2
Test (!EnvMatch trayer_width 0) \
PipeRead 'if [[ $[infostore.NotificationAreaManager] == stalonetray ]]; then echo FvwmStalonePanel \
    24 1 $(($[trayer_width]/24)) "--1" "+194" SE \
    24 $[trayer_width] "--1" "+194"; fi'
# Settings of trayer {{{2
Test (!EnvMatch trayer_width 0) \
    PipeRead 'if [[ $[infostore.NotificationAreaManager] == trayer ]]; then echo FvwmTrayerPanel \
    request pixel 24 right left 195 1; fi'

# Styles {{{1
Style FvwmButtons-Panel !Icon
Style FvwmButtons-Music !Icon
Style FvwmButtons-Clock !Icon
Style FvwmPager !Icon

# Styles for FvwmButtons-Music
Style FvwmButtons-Musi* NoIcon
EdgeCommand Right All (FvwmButtons-Music) ShowWindowOnTop

Echo /--------- Fvwm-Crystal: Recipe loaded ---------/
#PrintInfo Locale 1 #2
#PrintInfo infostore

# ViM modeline {{{1
# vim:foldmethod=marker:foldenable:foldlevel=0:ft=fvwm
