SUMMARY - 2.3: openwin colors, mailtool, background images

From: Pamela S. Pledger (pamela@jupiter.Legato.COM)
Date: Thu Jun 15 1995 - 19:18:59 CDT

Hi !

        It's been a while. I am sorry for the delay.
        I'd like to thank the following people for their quick
responces :

        Here is my original question :

> Number one problem:
> Our applications are using up all the colors, and not
> only are we getting errors, we are getting unusable
> applications. I have called each vender for a method
> to limit their colors. Most have a monocrome version,
> and we are trying some of that. But what's the use
> of purchasing these expensive color monitors, eh?
> Is there some trick, or method to increase the number
> of colors available. ( The PC people are laughing at
> us..... )

        The basic answer to this is that there is no
way to get more colors. There are 256.
> Number two problem :
> One of our applications automatically opens up mailtools.
> Which automatically panic's one of our hosts. Any ideas?

        No one really had any ideas, here.
> Number three problem:
> I hate doing this, but we have this cool company logo
> that they want to put on the lab machines. How do I
> change the background. ( I think it has something to
> do with xload and .openwin-init. ) Can it just be
> any gif? Any tricks?

        It seems that I am one of the last to know about
xloadimage, xv or bitmap. These were to consitent ways
to to this.

> Obviously, I have just started hacking away
> at my manpages and answerbook. I should have never
> have lost that openwin productivity manual.....

----- Begin Included Message -----
>From :

netscape -install

to tell it to use a private colormap

> Number three problem:

Grab 'xv' from

xv -root -quit -ncols x file.gif
(can be gif, jpeg, etc. etc.)

replace 'x' by a maximum number of colors to allocate (else you'll be making
problem #1 worse).
----- End Included Message -----

----- Begin Included Message -----

Maybe I can help with "Number Three Problem".

Here's what I do in 4.1.3 and when I log onto
a solaris box it seems to work okay.

In .xinitrc, I have the line ...
$OPENWINHOME/bin/xsetroot -bitmap /usr/openwin/share/include/Xol/bitmaps/stones

It works with any bitmap file.

----- End Included Message -----

----- Begin Included Message -----

> Number one problem:
#1 The number of colors you have displayable is really not
a function of the monitor (unless it's monochrome of course)
but of the graphics card you have installed. You probably only
have an 8-bit (i.e. 256 color) graphics card in your workstation.
This means that if you use too many color-hog applications you leave
few colors left for subsequent applications. One way around this is to
see if each aaplication can use it's own private color map. This means
that when the aaplication starts, it chooses it's own 256 color palette,
and as you change focus from one application to the next, the graphics
palette is swapped. This gives rise to funcky color schemes and unnerving
color swaps when you swap to other applications, but at least each
individual aaplication is locally "viewable".
Anyway, I don't know what aaplications you are running, but read the
man pages on each and see if they have a command line option to use
a private color map.

NOTE: Getting a 24-bit graphics card won't fix the problem either,
unless you upgrade from X11R5 (or whatever you have) to X11R6.
(I think :) )

> Number two problem :
> One of our applications automatically opens up mailtools.
> Which automatically panic's one of our hosts. Any ideas?
#2 I believe openlook (openwindows) automatically opens mailtool. To
stop this, you may
1) Close mailtool, then choose "Save Workspace" and next time
mailtool should not start.
2) Manually achieve the above by editing .openwin-init (in teh user's
home dir) and removing the line for mailtool. (If there's an
.openwin-init.BAK, delete that file, or your changes won't take effect).
3) SEVERE: Get rid of mailtool (or move it) if you don't want it to start.
(Or remove execute &/or read permissions for everyone)

> Number three problem:
#3 First of all, a warning. Putting a color image on your background
impacts question #1 (i.e. may reduce # of usable colors). But otherwise,
look for xloadimage.tar.gz on ftp sites. This nifty tool can load a variety
of image formats onto the root window (background).

----- End Included Message -----

----- Begin Included Message -----

   1) There is no trick for increasing the number of colors available.
       The X Window system allows for different color models, but your
       graphics card is a limiting factor. If the best it can do is
       256 colors (8 bit), then that is all that can be managed.
       That said, the applications are designed poorly if they allocate
       as read/write most (or all) of the colormap. There are ways to
       properly allocate colors and share the colormap or to create
       private colormaps (which then cause strange colors to appear on
       the rest of your screen as you move from window to window) which
       should be implemented by the vendors.

   2) Don't know about the panics from mailtool (but I am running 2.4, not

   3) You can use public domain programs like xv or xloadimage to place
       gifs (or almost any image format) onto the background. However, note
       that the colors in the image will be allocated in the colormap, so
       you should have a limited number of colors.

----- End Included Message -----

----- Begin Included Message -----

To show a picture on the background, get the program
xv I believe it is on I'll even get you an
      executable if you really need it that way.

and use the command
xv -nc 8 -root -max -quit -dit baby3.tif &

the format of the graphic can be just about anything. The command line
I just gave was to load the background (and use just 8 colors) and quit

However xv has an interactive mode where it can convert between many many
graphic formats. Maybe that will allow you to score some points with the
pee cee people.

----- End Included Message -----

----- Begin Included Message -----

>From - Colors

It's quite possible to run out of colors on 8-bit (256 color) systems.
PC users should know that.

If you have 24-bit cards, you shouldn't see this problem if you run the
applications in the right 'visual'.

If you have 8-bit systems and run out of colors, you should see if some
of your applications can use a private colormap. You will get flashing
of colors when entering/leaving these applications, but each of them
will have 256 colors to itself. Among applications that can do this are
'xv' and 'netscape'. Netscape is usually one of the big culprits,
gobbling all available colors as soon as it starts up.

- Background
Will only make your situation worse, as it will eat even
more of your color map. It should be edited to use as few colors as
possible. You can see the colormap of a gif if you use 'xv'. If you
have xv, you can use it to load the background image as well. It will
let you center, tile, resize, etc from the command line.
----- End Included Message -----

----- Begin Included Message -----

colormaps are hard - that is why vendors are encouraged to use the shared
map. The applications shouldn't be unusable - they should load a private
colormap when they "have focus" (i.e. you can type at them, the mouse is
there &c)

As for backgrounds, you can use xsetroot for most things, I tend to use
xloadimage, as I can compress the colormap too. xloadimage -root does
a good job, but you'll most likely have to compile it up.

----- End Included Message -----

----- Begin Included Message -----

On your third question I have a simple answer.
Look into the command 'xsetroot'.

xsetroot(1) -bitmap 'bitmapfile'

You can Make/Edit/Convert? your `bitmapfile` with
the command 'bitmap`.

----- End Included Message -----

----- Begin Included Message -----

  Yes , if you install the X11R6 package , as far as I remember ,
you won't be limited to 256 colors only .
  However , I am not sure if the X-terminals aren't bounded
to some number of colors .
  Nevertheless , for consoles it has to be a solution .

  If you open mailtool manually , does it panic that system ?

  A number of tricks .

1) xv -root somefile.gif
2) xsetroot (works good only with some types of files)
3) xpmroot (for xpm ) , use xv or something else to convert gif to xmp .

  Now where to put a call to that trick .

  A number of choises :

1) ~/.xinitrc of each user
2) ~/.openwin-int of each user
3) /usr/openwin/lib/Xinitrc
4) /usr/openwin/lib/openwin-init
5) if you use Xdm for the X-terminals :
  a) call the gif-placing program in the ~/.xsession of each user
(don't forget to chmod 700 it)
  b) in the system script which you use with Xdm
6) if you use a specific window manager (fvwm , for example) :
  ~/.fvwmrc of each user

   Choose the best .

   Be aware that every user can change that logo after he logs in .
----- End Included Message -----

Pamela Pledger
Unix System Administration
Legato Systems, Inc

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:26 CDT