Re: FVWM: fvwm and M4

From: <jmknoble_at_pobox.com>
Date: Sun, 4 May 1997 01:01:49 -0400 (EDT)

Andreas--

On Sat, 3 May 1997, Andreas Schumann wrote:

: I am using Redhat Linux 4.1 on an Intel Pentium.
: I try to use fvwm2 as a windows manager. My system came preconfigured
: with a line like

  [...]

: What does this M4 stuff do for me? Can I use "normal" .fvwm2rc files
: (e.g. created by dotgenerator) and rename them to .fvwm2rc.m4 to get
: some advantage of using m4. I'm sorry, but I'm totally confused??!:(

The advantages of using m4 for your .fvwmrc are somewhat similar to
the advantages of using the C preprocessor for your .fvwmrc. For
instance, using m4, the following lines give me either a mini-icon or a
full-size icon, all depending on whether _FvwmUseMiniIcons is 1 or not:

    # ...
    # Make this 0 for full-size icons.
    m4_define(`_FvwmUseMiniIcons_', `1')
    m4_ifelse(
    _FvwmUseMiniIcons_, `1', `
    m4_define(`_Icon', `NoIcon, MiniIcon mini/$1')
    ', `
    m4_define(`_Icon', `Icon $1')
    ')
    # ...
    Style "control-panel" _Icon(3d/preferences-choose.xpm)
    Style "Network Configurator" _Icon(3d/networking-phone.xpm)
    Style "XJed*" _Icon(3d/editor-app.xpm)
    Style "xterm" _Icon(3d/shell.xpm)
    # ...

This sort of thing can be useful if you run multiple versions of fvwm,
some of which support certain features, and others of which don't; i've
got a set of config files that work cleanly with no modifications
whether i'm using fvwm-1.24r or fvwm-2.0.45.

FvwmM4 also defines variables that can be useful; for instance, the
following menu displays information about the currently running fvwm2
session (note that it uses tabs between labels (`Fvwm version') and
their values (`FVWM_VERSION) for better formatting):

    AddToMenu "AboutFvwm" "- About -" Title
    + "Fvwm version FVWM_VERSION" Nop
    + "Compiled with OPTIONS" Nop
    + "" Nop
    + "`X'VERSION Server by VENDOR" Nop
    + "Running on SERVERHOST" Nop
    + "Clients on CLIENTHOST (OSTYPE)" Nop
    + "Display pixels WIDTH x HEIGHT" Nop
    + "Visual CLASS (PLANES`bpp')" Nop
    + "Pixels per meter X/Y X_RESOLUTION/Y_RESOLUTION" Nop

and this makes sure to look under my home directory for pixmaps:

    PixmapPath `'HOME`'/lib/X11/icons/pixmaps:/usr/include/X11/pixmaps

Look on your Red Hat Linux system in /etc/X11/TheNextLevel/ (use `ls
-a' to see all the files) for interesting uses of m4.

You can use regular .fvwmrc files with FvwmM4, but there are some
things to beware of if you do; for instance, m4 uses keywords such as
`define' and `include', and if you use them in your .fvwmrc
without meaning m4 to interpret them, the results my not be what you
intend. You can work around that somewhat by using the `-m4-prefix'
option with FvwmM4. If you don't like the regular m4 quotes (<`> and
<'>), you can change them with `-m4-squote' and `-m4-equote' (m4 has
other ways to do so as well).

Note, though, that if you don't really want to use m4, you might want
to change your .Xclients script so it instead.

: I found something in the archives but this wasn't very helpful, and yes
: I checked the FvwmM4 man page!

m4 has an info page; you can read it using the `info' program:

    info

peace.

--jim

############### jim knoble ######## jmknoble_at_pobox.com #################

--
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 Sun May 04 1997 - 00:02:50 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST