| 1 |
# Decoration-Functions |
| 2 |
# Written by: Maciej Delmanowski <[email protected]> |
| 3 |
|
| 4 |
# Set default button model on the titlebars |
| 5 |
CheckPreferences LastChoosenButtonModel 'SavePreferences LastChoosenButtonModel "SetEnv Window_Decorations_ButtonModel Theme.fvwm-crystal"' |
| 6 |
LoadPreferences LastChoosenButtonModel |
| 7 |
|
| 8 |
# Set default decoration if user haven't choosed it himself |
| 9 |
CheckPreferences LastChoosenWindowDecoration 'SavePreferences LastChoosenWindowDecoration "Window-Decorations-Set $[FVWM_SYSTEMDIR]/decorations/Crystal/DarkDesktop"' |
| 10 |
|
| 11 |
DestroyFunc Window-Decorations-Set |
| 12 |
AddToFunc Window-Decorations-Set |
| 13 |
+ I Test (f '$0/$[Window_Decorations_ButtonModel]') Read '$0/$[Window_Decorations_ButtonModel]' |
| 14 |
#+ I TestRc (Match) KeepRc Include components/styles/Window-Decorations |
| 15 |
+ I TestRc (Match) KeepRc SavePreferences LastChoosenWindowDecoration "Window-Decorations-Set $*" |
| 16 |
+ I TestRc (NoMatch) KeepRc FindFile Window_Decorations_ButtonModel-Temp '$0' Theme.nextstep Theme.os2 Theme.macosx Theme.windows Theme.amigaos Theme.fvwm-crystal |
| 17 |
+ I TestRc (NoMatch) Test (f '$0/$[Window_Decorations_ButtonModel-Temp]') Read '$0/$[Window_Decorations_ButtonModel-Temp]' |
| 18 |
#+ I TestRc (Match) KeepRc Include components/styles/Window-Decorations |
| 19 |
+ I TestRc (Match) KeepRc SavePreferences LastChoosenWindowDecoration "Window-Decorations-Set $*" |
| 20 |
+ I UnsetEnv Window_Decorations_ButtonModel-Temp |
| 21 |
+ I Style * HandleWidth $[infostore.handle_width] |
| 22 |
|
| 23 |
|
| 24 |
DestroyMenu /Window-Decorations |
| 25 |
AddToMenu /Window-Decorations |
| 26 |
+ MissingSubmenuFunction Window-Decorations-generator |
| 27 |
+ '%22x22/categories/directory.png%$[gt.System]' Popup $[FVWM_SYSTEMDIR]/decorations |
| 28 |
Test (f $[FVWM_USERDIR]/decorations) + '%22x22/categories/directory.png%$[gt.User]' Popup $[FVWM_USERDIR]/decorations |
| 29 |
+ "" Nop |
| 30 |
+ '$[gt.Button model]' Popup /Window-Decorations-ButtonModel |
| 31 |
|
| 32 |
|
| 33 |
DestroyFunc Window-Decorations-generator |
| 34 |
AddToFunc Window-Decorations-generator |
| 35 |
+ I DestroyMenu $0 |
| 36 |
+ I AddToMenu $0 |
| 37 |
+ I PipeRead 'for directory in $0/*; do \ |
| 38 |
if [ $(ls "${directory}" | wc -l) -gt 1 ]; then \ |
| 39 |
dirname=$(basename "${directory}"); \ |
| 40 |
dirid=$(echo "${dirname}" | sed -e "s:\ :_:g"); \ |
| 41 |
echo \"AddToMenu \'$0\' \'%22x22/fvwm-crystal/dd.png%${dirname}\' Popup \'$0/${dirid}\'\"; \ |
| 42 |
echo \"DestroyMenu \'$0/${dirid}\'\"; \ |
| 43 |
for themedir in "${directory}"/*; do \ |
| 44 |
themedirname=$(basename "${themedir}"); \ |
| 45 |
echo \"AddToMenu \'$0/${dirid}\' \'%22x22/fvwm-crystal/df.png%${themedirname}\' Window-Decorations-Set \'${themedir}\'\"; \ |
| 46 |
done \ |
| 47 |
elif [ $(ls "${directory}" | wc -l) -eq 1 ]; then \ |
| 48 |
dirname=$(basename "${directory}"); \ |
| 49 |
echo \"AddToMenu \'$0\' \'%22x22/fvwm-crystal/df.png%${dirname}\' Window-Decorations-Set \'${directory}/$(ls \"${directory}\")\'\"; \ |
| 50 |
fi \ |
| 51 |
done' |
| 52 |
|
| 53 |
|
| 54 |
DestroyMenu /Window-Decorations-ButtonModel |
| 55 |
AddToMenu /Window-Decorations-ButtonModel |
| 56 |
+ "FVWM-Crystal" Window-Decorations-SetButtonModel Theme.fvwm-crystal |
| 57 |
+ "AmigaOS" Window-Decorations-SetButtonModel Theme.amigaos |
| 58 |
+ "MS Windows" Window-Decorations-SetButtonModel Theme.windows |
| 59 |
+ "MacOS X" Window-Decorations-SetButtonModel Theme.macosx |
| 60 |
+ "OS/2" Window-Decorations-SetButtonModel Theme.os2 |
| 61 |
+ "NeXTStep" Window-Decorations-SetButtonModel Theme.nextstep |
| 62 |
|
| 63 |
DestroyFunc Window-Decorations-SetButtonModel |
| 64 |
AddToFunc Window-Decorations-SetButtonModel |
| 65 |
+ I SetEnv Window_Decorations_ButtonModel "$*" |
| 66 |
+ I SavePreferences LastChoosenButtonModel "SetEnv Window_Decorations_ButtonModel '$*'" |
| 67 |
+ I LoadPreferences LastChoosenWindowDecoration |
| 68 |
|
| 69 |
# vim:ft=fvwm |