Subject: FVWM: fvwm using "compatible" colors

From: Martin Kraemer <[email-masked]>
Date: Fri, 19 Apr 1996 16:12:17 +0200 (MET DST)

Hello again,

As you know by now, I still have a X11R4 server. And I like to use fvwm
on this machine as well as on my Linux X11R6 at home. Therefore I think
it would be sensible to make "plain fvwm" runnable on all X11R{4,5,6,6.1}
platforms.

Yesterday, I sent out a list of "not compatible" colors. I re-checked
today (I always had wondered what the error messages from all the fvwm's
I use (1.24, 2.0.41, 2.0.42) meant:
    [FVWM][nocolor]: <<ERROR>> can't parse color slategrey
    fvwm: can't parse color slategrey
). Here's what I found:

1)  "plain fvwm" has a built-in startup command
      ExecuteFunction("MenuStyle black grey slategrey fixed fvwm", ...)
    which references the (X11R5-and-above-only) color slategrey.
    The patch to use grey50 instead follows below.

2)  system.fvwmrc uses (too) many different colors, two of which are
    completely unknown under X11R4: palevioletred and LightSkyBlue are
    candidates for replacement by a different "close" color from the set
    of named colors; The unnamed colors should be chosen from the set of
    named colors as well. Using Romano <[email-masked]> Giannetti's
    "pixy" program, the following replacement table comes to mind (the
    (dist nnnn) tells you how "different" the replacement color is from
    the original color):
      #40a0c0                            -         sky blue (dist 169.387)
      #484048                            -           gray26 (dist  20.793)
      #554055                            -           violet (dist  31.169)
      #5f9ea0                            -       cadet blue (dist   1.973)
      #705070                            -           violet (dist 136.791)
      #908090                            -           gray52 (dist 117.541)
      #aa80aa                            -      blue violet (dist 198.276)
      #cab3ca                            -          thistle (dist  13.309)
      #cfcfcf                            -           gray81 (dist   0.000)
      Black                              -            black (dist   0.000)
      Green                              -            green (dist   0.000)
      LightSkyBlue(X11R5)/#87cefa(X11R4) -         sky blue (dist 278.405)
      MidnightBlue                       -    midnight blue (dist   0.000)
      Yellow                             -           yellow (dist   0.000)
      blue                               -             blue (dist   0.000)
      grey40                             -           gray40 (dist   0.000)
      grey60                             -           gray60 (dist   0.000)
      maroon                             -           maroon (dist   0.000)
      palevioletred(X11R5)/#db7093(X11R4)-medium violet red (dist   0.000)
      steelblue                          -       steel blue (dist   0.000)
    (Well, I think I would use gray25/50/80 in place of 26/52/81...)
    THESE ARE NO 1:1 REPLACEMENTS! But they help new users on older
    platforms to initially use fvwm (without a private .fvwmrc, fvwm won't
    start correctly unless it has successfully loaded the basic menu colors).
    Using the derived sed script (X11R4.sed) below, and executing
	sed -f X11R4.sed new-system.fvwmrc.orig >new-system.fvwmrc
    we get the diffs below for an X11R4-capable system.fvwmrc.

    I do hope that these patches can help anybody out there who's still
    stuck on X11R4....

    Have fun,
	Martin

--- fvwm/fvwm.c.bak  Thu Apr 11 16:52:19 1996
+++ fvwm/fvwm.c      Fri Apr 19 13:54:47 1996
@@ -338,7 +338,7 @@
   /* read config file, set up menus, colors, fonts */
   ExecuteFunction("HilightColor black grey",NULL,&Event,C_ROOT,-1);
   ExecuteFunction("XORValue 255",NULL,&Event,C_ROOT,-1);
-  ExecuteFunction("MenuStyle black grey slategrey fixed fvwm",
+  ExecuteFunction("MenuStyle black grey grey50 fixed fvwm",
                   NULL,&Event,C_ROOT,-1);
   ExecuteFunction("TitleStyle Centered Raised",NULL,&Event,C_ROOT,-1);
   ExecuteFunction("IconFont fixed", NULL,&Event,C_ROOT,-1);

--- sample.fvwmrc/new-system.fvwmrc.orig        Fri Apr 19 16:01:56 1996
+++ sample.fvwmrc/new-system.fvwmrc    Fri Apr 19 16:04:20 1996
@@ -451,7 +451,7 @@
 #
 # Colors
 *FvwmButtonsFore Black
-*FvwmButtonsBack #908090
+*FvwmButtonsBack gray50
 
 # Font 
 *FvwmButtonsFont	5x8
@@ -471,10 +471,10 @@
 #*FvwmButtons (de)Iconify	eyenew.xpm	Iconify
 #*FvwmButtons Restart eye2.xpm     Restart
 #*FvwmButtons Xcalc   rcalc.xpm   Exec "Calculator" xcalc &
-#*FvwmButtons junk   3dx.xpm     Swallow "xload"  xload -bg \#908090
+#*FvwmButtons junk   3dx.xpm     Swallow "xload"  xload -bg gray50
 #*FvwmButtons xmter x.xpm	     Swallow "xmter" xmter &
-#*FvwmButtons ""  clock.xpm   Swallow "xclock" xclock -bg \#908090 -padding 0 &
-#*FvwmButtons "" 3dx.xpm Swallow "Time 3D" t3d -fg \#908090 -mag .3 -wobber 0 &
+#*FvwmButtons ""  clock.xpm   Swallow "xclock" xclock -bg gray50 -padding 0 &
+#*FvwmButtons "" 3dx.xpm Swallow "Time 3D" t3d -fg gray50 -mag .3 -wobber 0 &
 
 ############################################################################
 # FvwmIdent
@@ -501,7 +501,7 @@
 ############################################################################
 # FvwmWinList
 #
-*FvwmWinListBack #908090
+*FvwmWinListBack gray50
 *FvwmWinListFore Black
 *FvwmWinListFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
 *FvwmWinListAction Click1 Iconify -1,Focus
@@ -520,10 +520,10 @@
 # FvwmIconBox
 #
 # NOTE: Icons will only be shown in module if Style "??" NoIcon is set
-*FvwmIconBoxIconBack    #cfcfcf
+*FvwmIconBoxIconBack    gray80
 *FvwmIconBoxIconHiFore  black
-*FvwmIconBoxIconHiBack  LightSkyBlue
-*FvwmIconBoxBack        #5f9ea0
+*FvwmIconBoxIconHiBack  SkyBlue
+*FvwmIconBoxBack        CadetBlue
 #*FvwmIconBoxFore       blue
 *FvwmIconBoxGeometry    5x1+0+0
 *FvwmIconBoxMaxIconSize 64x38

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  X11R4.sed
# Wrapped by martin@deejai on Fri Apr 19 16:05:08 1996
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'X11R4.sed' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'X11R4.sed'\"
else
echo shar: Extracting \"'X11R4.sed'\" \(455 characters\)
sed "s/^X//" >'X11R4.sed' <<'END_OF_FILE'
Xs:\\#40a0c0:SkyBlue:g
Xs:\\#484040:gray25:g
Xs:\\#554050:violet:g
Xs:\\#5f9ea0:CadetBlue:g
Xs:\\#705070:violet:g
Xs:\\#908090:gray50:g
Xs:\\#aa80aa:BlueViolet:g
Xs:\\#cab3ca:thistle:g
Xs:\\#cfcfcf:gray80:g
Xs:#40a0c0:SkyBlue:g
Xs:#484040:gray25:g
Xs:#554050:violet:g
Xs:#5f9ea0:CadetBlue:g
Xs:#705070:violet:g
Xs:#908090:gray50:g
Xs:#aa80aa:BlueViolet:g
Xs:#cab3ca:thistle:g
Xs:#cfcfcf:gray80:g
Xs:[Ll]ight[Ss]ky[Bb]lue:SkyBlue:g
Xs:[Pp]ale[Vv]iolet[Rr]ed:MediumVioletRed:g
END_OF_FILE
if test 455 -ne `wc -c <'X11R4.sed'`; then
    echo shar: \"'X11R4.sed'\" unpacked with wrong size!
fi
# end of 'X11R4.sed'
fi
echo shar: End of shell archive.
exit 0
-- 
| S I E M E N S |   [email-masked]   |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
--
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: Martin Kraemer <[email-masked]>
Date: Fri, 19 Apr 1996 16:56:02 +0200 (MET DST)

Martin Kraemer wrote
>     we get the diffs below for an X11R4-capable system.fvwmrc.

Oops... sorry, I forgot to check if new-system.fvwmrc was used at all--
it isn't!

So, here are the diffs for system.fvwmrc (they may not be perfect, but...):

Have a nice weekend,

    Martin

--- system.fvwmrc.orig	Mon Feb 19 04:18:51 1996
+++ system.fvwmrc	Fri Apr 19 16:54:49 1996
@@ -39,7 +39,7 @@
 PixmapPath /usr/include/X11/pixmaps/
 IconPath   /usr/include/X11/bitmaps/
 
-HilightColor black palevioletred
+HilightColor black MediumVioletRed
 DeskTopSize 2x2
 MenuStyle maroon grey60 grey40 -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-* fvwm
 ClickTime 750
@@ -47,7 +47,7 @@
 ColormapFocus FollowsMouse
 
 Style "*"           BorderWidth 5, HandleWidth 5
-Style "*"           Icon unknown1.xpm, Color Black/#40a0c0
+Style "*"           Icon unknown1.xpm, Color Black/SkyBlue
 Style "*"           ActivePlacement, SmartPlacement
 Style "*"           MWMFunctions,MWMDecor,HintOverride
 Style "*"           DecorateTransient,IconBox 0 -10 -280 -1
@@ -67,7 +67,7 @@
 Style "signal"      StartsOnDesk 3 
 Style "rxvt"        Icon  term.xpm,SloppyFocus,IconBox -70 1 -1 -140
 Style "XTerm"       Icon xterm.xpm,IconBox -70 1 -1 -140
-Style "XTerm"       Color black/#aa80aa,MWMBorder,MWMButtons
+Style "XTerm"       Color black/BlueViolet,MWMBorder,MWMButtons
 Style "Appointment" Icon datebook.xpm, NoButton 2, NoButton 4,ClickToFocus
 Style "xcalc"       Icon xcalc.xpm, NoButton 2,RandomPlacement,ClickToFocus
 Style "xmh"         Icon mail1.xpm, NoIconTitle,StickyIcon
@@ -124,10 +124,10 @@
 
 ########################Initialization Functions ############################
 AddToFunc InitFunction 	  "I" Module FvwmButtons
-+			  "I" exec xsetroot -mod 2 2 -fg \#554055 -bg \#705070
++			  "I" exec xsetroot -mod 2 2 -fg violet -bg gray40
 
 AddToFunc RestartFunction "I" Module FvwmButtons
-+			  "I" exec xsetroot -mod 2 2 -fg \#554055 -bg \#705070
++			  "I" exec xsetroot -mod 2 2 -fg violet -bg gray40

 ########################Menus ########################################
@@ -246,7 +246,7 @@
 ################## FvwmButtons button-bar ################################
 # Colors
 *FvwmButtonsFore Black
-*FvwmButtonsBack #908090
+*FvwmButtonsBack gray50
 
 # Font
 *FvwmButtonsFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
@@ -266,7 +266,7 @@
 *FvwmButtons signal rterm.xpm	Exec "XTerm" rxterm signal &
 *FvwmButtons mail    mail2.xpm    Function MailFunction xmh "-font fixed"
 
-*FvwmButtons whatever  clock.xpm   Swallow "Clock" Exec rclock -bg \#908090 -geometry -1500-1500 -font -*-times-*-r-*-*-17-*-*-*-*-*-*-* -mailupdate 10 &
+*FvwmButtons whatever  clock.xpm   Swallow "Clock" Exec rclock -bg gray50 -geometry -1500-1500 -font -*-times-*-r-*-*-17-*-*-*-*-*-*-* -mailupdate 10 &
 *FvwmButtons(4x1) - whatever Swallow "FvwmPager" Module FvwmPager 0 3
 
 ########################## Window-Identifier ###############################
@@ -276,10 +276,10 @@
 *FvwmIdentFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*
 
 ########################### Pager #########################################
-*FvwmPagerBack #908090
+*FvwmPagerBack gray50
 *FvwmPagerFore #484048
 *FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
-*FvwmPagerHilight #cab3ca
+*FvwmPagerHilight thistle
 *FvwmPagerGeometry -1-1
 *FvwmPagerLabel 0 Misc
 *FvwmPagerLabel 1 Maker
@@ -288,7 +288,7 @@
 *FvwmPagerSmallFont 5x8
 
 ##########################FvwmWinList##################################
-*FvwmWinListBack #908090
+*FvwmWinListBack gray50
 *FvwmWinListFore Black
 *FvwmWinListFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
 *FvwmWinListAction Click1 Iconify -1,Focus
@@ -311,10 +311,10 @@
 #Style     "*"  NoIcon
 
 ############################################################