FVWM: Variables

From: Andrew Veliath <veliaa_at_rpi.edu>
Date: Tue, 2 Apr 1996 00:16:49 -0500

>>>>> Buck Rogers, with all his glory, exclaimed:
>>>>> "All gasp at the words of the android Kevin Werner!"

    Kevin> I am using Fvwm 1.24. Is it possible to use variables in
    Kevin> the .fvwmrc file? I'd like to create some variables for
    Kevin> colors, so I don't have to change the colors throughout the
    Kevin> file. Ex:

    Kevin> COLOR1=black COLOR2=grey COLOR3=grey75
    Kevin> I remember seeing some info on this in the list, but I
    Kevin> haven't been able to locate in the archive. Any help or
    Kevin> ideas would be appreciated.

I don't think you can do this directly with fvwm, but you can
certainly do this with the m4 preprocessor (I do something
similar with HTML).

You have to read the man page to get the m4 preprocessor working, but
once you do, you might want to include a fvwm_config.m4 file or
the top of your fvwmrc file, where you might put something like:

define(COLOR1,black)
define(COLOR2,grey)
define(COLOR3,grey75)

...then it will replace all of the occurrences as necessary. If you
append a dnl right after each line above it will also get rid of blank lines.

However, m4 also has other macros which do other things. The best way
to configure this safely is to make your fvwmrc m4 file and m4 it
manually, i.e. "m4 <fvwmrcfile >tmpfile" then diff it with the
original to see if anything OTHER than the macros you have defined
have changed. If so, you will probably need to use the quoting
mechanisms or undefine something (see below).

Once I wrote a small program to return a random command-line argument
so that I could backquote the return value; with this I could assign a
random color scheme to the desktop on every startup.

M4 preprocessing gives you all kinds of neat power, you can run shell
commands and create some intricate macros (for instance, you might
have the date or the current user at the top of you menu with esyscmd
or something).

However, if you need to reference a macro word, such as include or
shift, you have to either undefine it or quote it (i.e. `shift').

Have fun,
Andrew Veliath <veliaa_at_rpi.edu>
http://www.rpi.edu/~veliaa
Finger for PGP Key
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Apr 01 1996 - 23:14:10 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:58 BST