Subject: FVWM: Variables

From: Kevin Werner <[email-masked]>
Date: Mon, 01 Apr 1996 23:49:28 -0800

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

COLOR1=black
COLOR2=grey
COLOR3=grey75

HiForeColor     $COLOR1
HiBackColor     $COLOR3
PagerBackColor	$COLOR2
PagerForeColor  $COLOR1
*GoodStuffFore	$COLOR2
*GoodStuffBack	$COLOR2
 
Popup "Xterms"
   Exec "Xterm" exec xterm -bg $COLOR1 -fg #COLOR2
   Exec "Xterm" exec xterm -bg $COLOR2 -fg #COLOR1
EndPopup

What I really want, is to have several color sets.  Then I could switch 
between them.  Is there a "read" command for 1.24?

Popup "Fvwm Colors"
   Read .fvwm.colors.greys "Greys"
   Read .fvwm.colors.browns "Browns"
   Read .fvwm.colors.blues "Blues"
EndPopup
...

I remember seeing some info on this in the list, but I haven't been able to 
locate in the archive.  Any help or ideas would be appreciated.

Thanks,
Kevin

-- 

 _______________________________________________________________
|                                                               |
|    Kevin Werner             mailto:[email-masked]          |
|     Kokomo, IN              http://www.holli.com/~kwerner     |
|                             http://www.holli.com/~xeno        |
|_______________________________________________________________|
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Andrew Veliath <[email-masked]>
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 <[email-masked]>
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Sean Kelly <[email-masked]>
Date: Tue, 2 Apr 1996 08:12:43 -0700

>>>>> "Kevin" == Kevin Werner <[email-masked]> writes:

    Kevin> file.

If I remember correctly, that version of fvwm processed its rc file
through the m4 macro preprocessor.  You could use m4 to define those
colors and use thier symbols where needed.  Just change the
definitions to change the color of the display.  See m4(1) for more
details.

-- 
Sean Kelly                          
NOAA Forecast Systems Laboratory    [email-masked]
Boulder Colorado USA                http://www-sdd.fsl.noaa.gov/~kelly/
--
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 [email-masked].
To report problems, send mail to [email-masked].