# Dock desktop, similar to the XFCE or CDE panel
# Written by: Maciej Delmanowski <harnir@post.pl>
#
# You can use folding to navigate this file

# ImagePath {{{1
SetEnv Icon-Theme "Default"
ImagePath $[FVWM_USERDIR]/icons/$[Icon-Theme]:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]

# Includes and FVWM modules {{{1
Module FvwmCommandS

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

# Preferred applications {{{2
Include components/functions/Screenshot-import
Include components/apps/XScreenSaver
Include components/apps/FvwmMiniConsole
Include components/apps/QuakeConsole

# 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

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

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

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

# Desktop settings {{{1
EdgeScroll	0	0
EdgeResistance	0	100
HideGeometryWindow	Move, Resize
OpaqueMoveSize	100
EdgeThickness	1

EWMH-Desktop 3 3 3 3
EWMH-Panel-Bottom 40

# Panel with main buttons {{{1
All (FvwmButtons-Panel) Close
DestroyModuleConfig FvwmButtons-Panel: *
*FvwmButtons-Panel: Geometry -3+3
*FvwmButtons-Panel: BoxSize smart
*FvwmButtons-Panel: ActiveColorset $[cs-panel-active]
*FvwmButtons-Panel: Colorset $[cs-panel-inactive]
*FvwmButtons-Panel: Rows 2
*FvwmButtons-Panel: Columns 2
*FvwmButtons-Panel: Padding 0 0
*FvwmButtons-Panel: Frame 0

# Button 1 - diamond {{{2
*FvwmButtons-Panel: (1x1, Size 18 18, Icon "16x16/fvwm-crystal/fvwm-crystal.png", \
Action (Mouse 1) Menu /FVWM-Crystal $[MenuPosition-NE], \
Action (Mouse 3) Wallpaper-Random $[FVWM_SYSTEMDIR]/wallpapers $[FVWM_USERDIR]/wallpapers ~/wallpapers /usr/local/share/wallpapers /usr/share/wallpapers)

# Button 2 - window list {{{2
*FvwmButtons-Panel: (1x1, Size 18 18, Icon "16x16/fvwm-crystal/window-list.png", \
Action (Mouse 1) Window-List "$[MenuPosition-NE]", \
Action (Mouse 2) All (CurrentPage) PlaceAgain anim, \
Action (Mouse 3) Window-List-Icons "$[MenuPosition-NE]")

# Button 3 - play (music) {{{2
*FvwmButtons-Panel: (1x1, Size 18 18, Icon "16x16/fvwm-crystal/media-playback-start.png", \
Action (Mouse 1) Menu /Music $[MenuPosition-NE], \
Action (Mouse 2) Music-GUI, \
Action (Mouse 3) Music-PlayPause, \
Action (Mouse 4) Mixer-Volume-Up 10, \
Action (Mouse 5) Mixer-Volume-Down 10)

# Button 4 - music controls {{{2
*FvwmButtons-Panel: (1x1, Size 18 18, Icon "16x16/fvwm-crystal/media-skip-forward.png", \
        Action (Mouse 1) Music-Next, \
        Action (Mouse 2) Nop, \
        Action (Mouse 3) Music-Prev, \
	Action (Mouse 4) Music-Forward, \
	Action (Mouse 5) Music-Backward)

# 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/apps/fvwm-crystal.png%$[gt.About FVWM-Crystal]' Include components/functions/About
+ '%22x22/fvwm-crystal/system-log-out.png%$[gt.Exit]' Popup /Exit

# Pager {{{1
All (FvwmPager) Close
DestroyModuleConfig FvwmPager: *

SetEnv Desk-Pages-X "4"
SetEnv Desk-Pages-Y "1"

PipeRead 'echo DesktopSize $[Desk-Pages-X]x$[Desk-Pages-Y]'

*FvwmPager: MiniIcons
*FvwmPager: Font none
*FvwmPager: WindowBorderWidth 1
*FvwmPager: Window3DBorders
#*FvwmPager: NoSeparators
*FvwmPager: UseSkipList
*FvwmPager: Colorset * $[cs-panel-inactive]
*FvwmPager: HilightColorset * $[cs-panel-active]
*FvwmPager: WindowColorsets $[cs-panel-wininactive] $[cs-panel-winactive]

# Dock, applications panel and menu generator {{{1
All (ApplicationPanel) Close
DestroyModuleConfig ApplicationPanel: *
*ApplicationPanel: BoxSize smart
*ApplicationPanel: ActiveColorset $[cs-panel-active]
*ApplicationPanel: Colorset $[cs-panel-inactive]
*ApplicationPanel: Rows 2
*ApplicationPanel: Padding 1 1
*ApplicationPanel: Frame 0

*ApplicationPanel: (2x2, Size 36 36, Swallow (Close, Respawn, FvwmModule) "FvwmButtons-Panel" 'Module FvwmButtons FvwmButtons-Panel')

# fvwm-crystal.apps {{{2
PipeRead 'fvwm-crystal.apps --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --with=/Applications/debian --search-icons-in=$[FVWM_USERDIR]/icons/$[Icon-Theme]/32x32/categories:$[FVWM_USERDIR]/icons/$[Icon-Theme]/32x32/apps:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/32x32/categories:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/32x32/apps --default-file-icon=32x32/apps/default.png --default-dir-icon=32x32/categories/directory.png --min-submenu-length=5 --sort=prio --panel-icons=standard --panel-action1=menu --panel-action2=none --panel-action3=menu --button-geometry=2 2 --menu-pos=N --menuname-suffix="Dock" --no-menus --check-execs'
PipeRead 'fvwm-crystal.apps --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --without=/Applications/debian --search-icons-in=$[FVWM_USERDIR]/icons/$[Icon-Theme]/32x32/categories:$[FVWM_USERDIR]/icons/$[Icon-Theme]/32x32/apps:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/32x32/categories:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/32x32/apps --default-file-icon=32x32/apps/default.png --default-dir-icon=32x32/categories/directory.png --min-submenu-length=5 --sort=prio --panel-icons=topapp --panel-action1=menu --panel-action2=none --panel-action3=topapp --button-geometry=2 2 --menu-pos=N --menuname-suffix="Dock" --no-menus --check-execs'
PipeRead 'fvwm-crystal.apps --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --search-icons-in=$[FVWM_USERDIR]/icons/$[Icon-Theme]/22x22/categories:$[FVWM_USERDIR]/icons/$[Icon-Theme]/22x22/apps:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/22x22/categories:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/22x22/apps --default-file-icon=22x22/apps/default.png --default-dir-icon=22x22/categories/directory.png --min-submenu-length=5 --menuname-suffix="Dock" --submenu-suffix="Item 100 o100" --sort=rprio --no-panel --check-execs'
PipeRead 'fvwm-crystal.apps --database=$[FVWM_SYSTEMDIR]/Applications --database=$[FVWM_USERDIR]/Applications --search-icons-in=$[FVWM_USERDIR]/icons/$[Icon-Theme]/22x22/categories:$[FVWM_USERDIR]/icons/$[Icon-Theme]/22x22/apps:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/22x22/categories:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/22x22/apps --default-file-icon=22x22/apps/default.png --default-dir-icon=22x22/categories/directory.png --min-submenu-length=5 --sort=prio --no-panel --check-execs'
# }}}2

# $[ApplicationPanelLength] is set by fvwm-crystal.apps, contains the number
# of the buttons on the panel
PipeRead 'echo SetEnv FvwmButtons-Panel-Width $((($[ApplicationPanelLength]*32)+144))'
PipeRead 'echo *ApplicationPanel: Geometry +$((($[vp.width]-$[FvwmButtons-Panel-Width])/2))-1'

*ApplicationPanel: (6x1, Size 108 18, Swallow (Close, Respawn, FvwmModule) "FvwmScript-Clock-24h-small_date" 'Function Script components/scripts/FvwmScript-Clock-24h-small_date')

*ApplicationPanel: (6x1, Size 108 18, Swallow (Close, FvwmModule) "FvwmPager" 'Module FvwmPager')

Module FvwmButtons ApplicationPanel

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

# Settings for FvwmIdent {{{1
*FvwmIdent: Font "xft:Tahoma:pixelsize=12:Bold"
*FvwmIdent: Colorset $[cs-panel-active]

# Settings for FvwmForm {{{1
*FvwmFormDefault: Colorset $[cs-panel-inactive]
*FvwmFormDefault: ItemColorset $[cs-panel-active]
*FvwmFormDefault: Font "xft:Tahoma:pixelsize=13"
*FvwmFormDefault: InputFont "xft:Monospace:pixelsize=13"
*FvwmFormDefault: ButtonFont "xft:Tahoma:pixelsize=13:Bold"
*FvwmFormDefault: TimeoutFont "xft:Tahoma:pixelsize=13:Bold"

# Settings of Trayer {{{1
AddToFunc ExitFunction I Exec exec killall trayer

AddToFunc StartFunction I Exec exec trayer \
--SetDockType false \
--widthtype request \
--heighttype pixel \
--height 24 \
--edge bottom \
--align right \
--transparent true \
--alpha $[TrayerAlpha] \
--tint $[TrayerTint] \
--margin 3 \
--distance 3

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