# TopLine desktop (former "1.1"
# Written by: Maciej Delmanowski <harnir@post.pl>
#
# You can use folding to navigate this file

# ImagePath {{{1
SetEnv Icon-Theme "Default"
SetEnv Image-Path $[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/22x22/apps:$[FVWM_SYSTEMDIR]/icons/$[Icon-Theme]/22x22/fvwm-crystal
ImagePath $[Image-Path]

# 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

# Settings for window placement and focus change after desktop switch {{{2
Include components/functions/Window-SetPlacementPolicy
Include components/functions/Window-Remember

# 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-Basic
Include components/bindings/Window-Basic
Include components/bindings/Window-Border

# Keyboard bindings {{{2
Include components/desktop/Keyboard
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	0
HideGeometryWindow	Move, Raise
OpaqueMoveSize	100
EdgeThickness	1

EWMH-Desktop 3 3 3 3
EWMH-Panel-Top 30

# Main menu panel {{{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 1
*FvwmButtons-Panel: Padding 1 1
*FvwmButtons-Panel: Frame 0

# Music controls {{{2
*FvwmButtons-Panel: (1x1, Size 22 22, Icon "fvwm-crystal-music-controls.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 music button, with some menus {{{2
*FvwmButtons-Panel: (1x1, Size 22 22, Icon "fvwm-crystal-music-play.png", \
Action (Mouse 1) Menu /Music $[MenuPosition-SW], \
Action (Mouse 2) Music-GUI, \
Action (Mouse 3) Music-PlayPause, \
Action (Mouse 4) Music-Volume-Up 10, \
Action (Mouse 5) Music-Volume-Down 10)

# Window list {{{2
*FvwmButtons-Panel: (1x1, Icon "fvwm-crystal-windows.png", \
Action (Mouse 1) Window-List "$[MenuPosition-SW]", \
Action (Mouse 2) All (CurrentPage) PlaceAgain anim, \
Action (Mouse 3) Window-List-Icons "$[MenuPosition-SW]")

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

# Main "diamond" menu {{{2
DestroyMenu /FVWM-Crystal
AddToMenu /FVWM-Crystal
+ '$[gt.Screensaver]' Popup /Screensaver
+ '$[gt.Screenshot]' Popup /Screenshot
+ "" Nop
+ '$[gt.Window decorations]' Popup /Window-Decorations
+ '$[gt.Colorsets]' Popup /Colorsets
+ '$[gt.Wallpaper]' Popup /Wallpaper
+ '$[gt.Preferences]' Popup /Preferences
+ "" Nop
+ '$[gt.Developer menu]' Popup /Developer
+ '$[gt.About FVWM-Crystal]' Include components/functions/About
+ '$[gt.Exit]' Popup /Exit
# }}}2

*FvwmButtons-Panel: (3x1, Size 60 24, Swallow (Close, Respawn) "FvwmScript-Clock-24h")

Module FvwmButtons FvwmButtons-Panel
Script components/scripts/FvwmScript-Clock-24h

# Applications panel and menu generator {{{1
All (ApplicationPanel) Close
DestroyModuleConfig ApplicationPanel: *
*ApplicationPanel: Geometry +3+3
*ApplicationPanel: BoxSize smart
*ApplicationPanel: ActiveColorset $[cs-panel-active]
*ApplicationPanel: Colorset $[cs-panel-inactive-MiniIcon]
*ApplicationPanel: Rows 1
*ApplicationPanel: Padding 1 1
*ApplicationPanel: Frame 0

# fvwm-crystal.apps {{{2
PipeRead 'fvwm-crystal.apps --check-files --menu-mainapp=last --sort-first=prio --menu-pos=S --styles=none --panel-action1=menu1 --panel-action2=menu2 --panel-action3=mainapp --panel-default-action=definedifaviable --root-name=/Menu --root-title=FVWM-Crystal --root-length=8 -m $[FVWM_SYSTEMDIR]/preferences/ApplicationDatabase'
# }}}2

Module FvwmButtons ApplicationPanel

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

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

PipeRead 'echo SetEnv FvwmPager-Width $((28*$[Desk-Pages-X])); echo SetEnv FvwmPager-Height $((24*$[Desk-Pages-Y]))'
PipeRead 'echo *FvwmPager: Geometry $[FvwmPager-Width]x$[FvwmPager-Height]+$((($[vp.width]-$[FvwmPager-Width])/2))+3'
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]

Module FvwmPager

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

# Settings for icons on the desktop {{{1
Style * IconBox 1200x800+30-30, IconFill left bottom, IconGrid 30 30
Style * NoIconTitle
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:Bo

# Settings of Trayer {{{1
Include components/apps/Trayer
AddToFunc StartFunction I Trayer top right 174 3

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