2 AddToMenu MiscStyles "Decor Menu" Title
4 # Macro to define the decor function
5 # Arg 0, DecorName, creates a function of the same name that
6 # reads the function when the menu item is selected,
7 # and adds the item to the MiscStyles menu
8 # Optionally, a Decor can define the function "DecorRemoveHook"
9 # which is run whenever a new decor is loaded.
11 AddToFunc DecorHook I DestroyFunc $0
12 AddToFunc DecorHook I AddToFunc $0 I DecorRemoveHook
13 AddToFunc DecorHook I AddToFunc $0 I PipeRead 'rm .fvwm/.DecorCurrent 2>/dev/null'
14 AddToFunc DecorHook I AddToFunc $0 I PipeRead 'ln -s $0 .fvwm/.DecorCurrent 2>/dev/null'
15 AddToFunc DecorHook I AddToFunc $0 I read .DecorCurrent
16 AddToFunc DecorHook I AddToMenu MiscStyles "$1" $0
18 # Define an initial DecorRemoveHook:
19 DestroyFunc DecorRemoveHook
20 AddToFunc DecorRemoveHook I Nop
22 # Load up the decor menu:
23 PipeRead 'sed -n -e "s/\# DecorHook/DecorHook/p" .fvwm/Decor*[!~]'
24 AddToMenu MiscStyles "&X. Remove current decor" Exec rm .fvwm/.DecorCurrent 2>/dev/null
25 # Now load the current decor (if any)
26 read .DecorCurrent quiet