Simpler example: qvwm
Hopefully this will illustrate better how my system works. This example is
for the qvwm package. Here is the needed template:
-------- BEGIN system.qvwmrc-template --------------------
;
; system.qvwmrc
;
; Please read qvwm.man about details of settings.
;
;include $XLIBDIR/X11/qvwm/system.qvwmrc
[Variables]
\systable_nl(Package-qvwm-Variables,NAME = VALUE ; DESC)
;**********************************************************************
; Menu configuration
; <item name> <pixmap name> <action(exec file or qvwm func)>
; or
; <item name> <pixmap name>
; +
; ... (child menu)
; -
;
; Pixmap size is 32x32 in StartMenu section, 20x20 in the others.
; The third parameter is program, internal command (begining at
; QVWM_), or next section name.
; \&? sets a shortcut key '?' for the menu item.
;**********************************************************************
.... (The rest of the config file will follow without modifications) ...
-------- END system.qvwmrc-template --------------------
Since the format of the [Variables] section is so straightforward, the
maintainer will be able to generate automatically the table
"Package-qvwm-Variables" from the system.qvwmrc provided in the upstream
sources. For example, the following command could be used:
sed -n -e '/^\[Variables\]/,/^;\*\*\*/p' < system.qvwmrc | \
grep '=' | \
awk '{printf("NAME: %s\nVALUE: %s\nDESC: ",$1,$3);
for(i=5;i<=NF;i++) printf("%s ",$i);
printf("\n\n")}' > Package-qvwm-Variables
This command generates a file which starts like this:
-------- BEGIN Package-qvwm-Variables --------------------
NAME: LocaleName
VALUE: ""
DESC: locale name used in this file
NAME: PixmapPath
VALUE: "/usr/lib/X11/qvwm/pixmaps"
DESC:
...
-------- END Package-qvwm-Variables --------------------
Then the maintainer will distribute these two files: system.qvwmrc-template
and Package-qvwm-Variables. No configuration script is necessary. Nothing else
needs to be included for the configuration to work.
I hope this example illustrates better the idea of having templates.
Again, this is a working example. All code necessary for this to work is
already implemented. The part that is not implemented is the database editor.
I just use Emacs to edit the database, but if a GUI is desired something must
be written. Maybe the GNOME program "Gaby" is a good start. I haven't tried it
yet.
Thanks,
Fernando.
Reply to: