# SilentHacker desktop
# Written by: Maciej Delmanowski <harnir@linux.net.pl>

# 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
Include components/apps/OpenOffice.org
Include components/functions/Music-$[MusicPlayer]

# 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

# 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 0 0 0 0

# Applications generator and main menu{{{1
# This creates the menu with applications available under Alt+Win_R
PipeRead 'fvwm-crystal.apps --database=$[FVWM_DISTROMENUDIR]/Applications --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:$[FVWM_DISTROMENUDIR]/icons/$[Icon-Theme]/22x22/categories:$[FVWM_DISTROMENUDIR]/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 --panel-icons=topapp --panel-action1=menu --panel-action2=none --panel-action3=topapp --menu-pos=S --no-panel --check-execs'

# 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
+ '%22x22/fvwm-crystal/audio-x-generic.png%$[gt.Music]' Popup /Music
+ "" 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
+ '%22x22/fvwm-crystal/system-log-out.png%$[gt.Exit]' Popup /Exit


# InfoLine {{{1
DestroyFunc Get-InfoLine
AddToFunc Get-InfoLine
+ I PipeRead 'fvwm-crystal.infoline'
+ I SendToModule FvwmButtons-InfoLine ChangeButton InfoLine Title "$[FVWM_INFOLINE]"

All (FvwmButtons-InfoLine) Close
DestroyModuleConfig FvwmButtons-InfoLine: *
PipeRead "echo *FvwmButtons-InfoLine: Geometry $(($[vp.width]-240))x16-152+-1"
*FvwmButtons-InfoLine: BoxSize smart
*FvwmButtons-InfoLine: ActiveColorset $[cs-panel-active]
*FvwmButtons-InfoLine: Colorset $[cs-panel-inactive]
*FvwmButtons-InfoLine: Columns 1
*FvwmButtons-InfoLine: Padding 2 2
*FvwmButtons-InfoLine: Frame 0
*FvwmButtons-InfoLine: Font "xft:Verdana:pixelsize=11:Bold"
Test (EnvIsSet FVWM_FLAG_UTF-8) *FvwmButtons-InfoLine: Font "xft:Verdana:pixelsize=11:Bold:encoding=iso10646-1"

PipeRead 'fvwm-crystal.infoline'

*FvwmButtons-InfoLine: (1x1, Id "InfoLine", Title (Left) "$[FVWM_INFOLINE]", Action Get-InfoLine)

Module FvwmButtons FvwmButtons-InfoLine
Style FvwmButtons-InfoLine StaysOnTop

# Clock {{{1
All (FvwmButtons-Clock) Close
DestroyModuleConfig FvwmButtons-Clock: *
*FvwmButtons-Clock: Geometry -90+-1
*FvwmButtons-Clock: BoxSize smart
*FvwmButtons-Clock: ActiveColorset $[cs-panel-active]
*FvwmButtons-Clock: Colorset $[cs-panel-inactive]
*FvwmButtons-Clock: Columns 2
*FvwmButtons-Clock: Padding 2 2
*FvwmButtons-Clock: Frame 0

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

Module FvwmButtons FvwmButtons-Clock
Style FvwmButtons-Clock StaysOnTop

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

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

# Settings for icons on the desktop {{{1
Style * NoIcon

# vim:foldmethod=marker:foldenable:foldlevel=0:ft=fvwm
