XBanner is definitely not Linux-specific! It is not even Unix specific. Please refer to the Platforms section about tested platforms.
All I ask is that you contact me and tell me you are using it. My preferred way is a postcard
of your home area. This is just an encouragement thing. It will encourage me to continue and enhance
and maybe even add new effects, etc. Email is also possible. My addresses:
Email - amitm@doronx.iso.dec.com.
I would also like to specify that I wrote this for myself, and that I disclaim all and any liability bla bla bla... etc. In short:
#include <Legal/disclaim.h>
Before compiling under X11R4, see the Compilation
section for details about compiling in R4 environments.
If displaying over to a X11R4 server is desired, a large font (or fonts) is needed, which
are difficult to come by since X11R4 did not support true scalable fonts. The same is
true for OpenVMS users. The OpenVMS X-Server is an X11R5 server, but does not support scalable
fonts. In general, I am able to help by taking a freely-available scalable font, and
generating a .BDF
file from it. Please
email me for help on this.
Here is a short list of platforms I have tested XBanner on, and ones I have received success reports with:
Notes:
README
in the VMS/
directory for complete details.
xbanner.h
contains all the defaults and does not affect compilation. XBanner's default values can be
changed from there.
The second file is xb_config.h
which contains the configuration options. This
actually changes the output binary according to compile-time conditionals. Here is a
detailed description of the options included in xb_config.h
:
Definition | Meaning / Who should use |
---|---|
#define PRGCLASS "XBanner"
| This selects the program class-name. All resources can be looked for under this class-name.
If changed to 'X_Logo ' then one could specify resources like 'X_Logo.Thickness: 1 '
but XBanner will not recognize 'XBanner.* ' resources.
|
R4_RESOURCES
| This definition will use X11R4 Resource-Manager functions. This should only be used when compiling in a R4 environment. |
EXPLICIT_REGISTER_VARIABLES
| This is good for systems that don't have GCC. If using GCC, then the -O2 option will simply ignore the register
keyword, because GCC thinks it probably knows better. I have experimented a little, and found which routines could use
explicit register -defined variables, and set them. This speeds up a bit on systems that don't have GCC.
|
HAS_USLEEP
| If this line is commented out, XBanner will compile its own version of usleep() , because some systems don't
have it (Ultrix for example). Linux has usleep() .
|
HAS_STRCMPI
| If your system has the strcmpi() function or strcasecmp() , then make sure this line is not commented.
Linux users should leave this line not commented.
|
INT_PLASMA
| Commenting out this line causes XBanner to use floating-point arithmetic to generate PlasmaClouds. This is about 40% slower on Pentia, but looks a bit better. For Pentium-166MHz, or a 166MHz AlphaStation, this is probably not an issue. |
OTHER_FRAND()
| Under Linux, XBanner uses the Linux C-Library drand48() function to generate random numbers for the PlasmaCloud
effects. On other systems, it approximates this by using rand() , casting the result to float, then dividing
by RAND_MAX . This is slower and not as accurate. If your system has another function that generates random
floating-point numbers between 0.0 and 1.0, define it here.Example: #define OTHER_FRAND() drand48()
|
The last file one might want to edit is the Makefile
. There are 3 things to edit in the Makefile
:
CC
, RM
, INSTALL
, CP
, TAR
, and GZIP
.
Most importantly, if your system doesn't have gcc
, define CC differently!
Please make sure GZIP is defined as 'compress
' if your system doesn't have the gzip
utility.
BINDIR
(where the binary gets installed), and XLIBDIR
(where your
libX11.a
resides).
XPM
and XPMLIB
). Simply comment them out if your system doesn't have the XPM
library. If your libXpm.a
is not in ld
's library path, it is possible to change the definition from
XPMLIB =-lXpmto be:
XPMLIB =/usr/home/amitm/LIBS/libXpm.aor something similar.
That's it. Type 'make
' and it should compile. Then 'make install
' will
strip and copy the binaries to the binary directories.
Note that the random_effect
binary is not installed by 'make install
'.
xbanner
freetemp
freetemp
program will free those resources.
It is mandatory to use freetemp
if using any of the
Glint / Linger / Color-cycling features.
xb_check
stdin
expecting
a resource-file format. It looks for lines resembling XBanner resources
and tries to check that they are valid. (I haven't tested this on OpenVMS yet).
random_effect
xbanner -file <res-file>
for it.
For Debian 1.1 users, a Debian package (xb_13.deb) is available in the FTP directory and from the download page. If you are using the Debian distribution, and have Debian 1.1 already installed, please click here.
OpenVMS installation instructions are in the file XBanner1.3/VMS/README
.
If the following does not work on your system, or if you are unsure, you can take a look at the file
samples/_other_ideas/My_Home_Setup.tar
which contains the entire setup for my home system
including the Xsetup_0
and Xsession
scripts, so you can rummage through them.
Installing XBanner to work with XDM the way it should is fairly simple. The process involves modifying 2 script files, that's it.
A bit about XDM:
XDM is a short for XWindows Display Manager. As such it is a tool for managing different displays. Managing means that XDM takes over the display, does several initializations, puts on a login-box, and let's the user log in to the machine it is running from. After the user is successfully authenticated against the password file, XDM runs a script which eventually loads the window-manager. When the window-manager exits, the script ends, XDM does a reset, and starts over (initializations, login-box, etc.).
We need to put several lines into the script which XDM runs to do the initializations.
This is most usually placed in /usr/lib/X11/xdm
but some
Linux distributions have it at /etc/X11/xdm
. The file is usually
called Xsetup_0
. But these are just the usual, not necessarily
the right ones for your system. Here's a step-by-step guide to finding these files:
more /usr/lib/X11/xdm/xdm-config
'
DisplayManager._0.setup:The other begins with:
DisplayManager*session:Note the names of the files they point to. These will usually be
Xsetup_0
and Xsession
. I will hereafter refer to these by those names.
xconsole
so you'll have one with the
login-box.
Xsetup_0
freetemp
. This is a precautionary measure, but will save
you if something really bad happened when the previous session ended.
The second line is to run xbanner
itself. Notice that
the directory where xbanner
and freetemp
are installed
in might not be in the path. In this case, specify the
complete path to the programs (i.e. /usr/local/bin/X11/xbanner
).
Xsession
freetemp
from here as well. This should be
done near the top of the file. Preferably before anything else.
app-defaults
is to serve as a default configuration. Some of the
things that XBanner tries to do require some resources to be set for them to work properly.
The supplied samples/XBanner.ad
can be used as a good default (assuming
it works flawlessly for you), as well as a good starting point for new setups.
After typing make
try to test this setup by typing
./xbanner -file samples/XBanner.ad
. If the font cannot be found,
refer to the fonts section.
After you have edited it to suit your taste, copy the file XBanner.ad
to /usr/lib/X11/app-defaults
,
and make sure you rename it to XBanner
and not leave it there with
the .ad
suffix.
XBanner.ad
and work your way by modifying it. This is good because XBanner.ad
contains a list
of supported keywords near every resource that takes keywords.
However, sometimes you want to create your own resource file. First, please look at the different types of resources that XBanner can accept. The same type-names are used in the Resource Reference and in fact throughout the documentation.
atof()
function to read
this value, and allows the use of scientific notation, the xb_check
program
checks it itself, and allows only the simple XX.YY notation.
#RRGGBB
' or '#RRRRGGGGBBBB
'. The
RGB components are given in Hexadecimal.
xdm-photo
, a XDM variant that shows people's faces, and you click your face,
and type the password. If you are using xdm-photo
, you are probably even more limited in the
number of colors you can use. Also, it was brought into my attention that xdm-photo
draws its login-box before running the Xsetup_0
script, and this causes various problems
with image-type effects (see below).
So how do you know if you have scalable fonts at all? How do you know which ones are scalable? All of these questions are answered in a separate document I wrote. Here it is. Please read it thoroughly and make sure that you have scalable fonts, and you know their names before we can continue with the rest of this guide.
Usually, class names have their first letters capitalized. Application class-names are also capitalized, unless the
application name starts with X in which case, by convention, the first 2 letters are capitalized. Hence XBanner's
instance name is usually 'xbanner
' and its class-name is usually 'XBanner
'.
In general, instance names take precedence over class names. XBanner is no exception to this rule. It is possible to exploit this mechanism in various ways. For instance, it is possible to create a single resource file, that will bind in it all the necessary information to create a two-line login-screen.
Here is an example resource file that does exactly that. This file assumes that you have a link from
xbanner
to xb_line2
and that the script runs xbanner
before xb_line2
:
! XBanner 1.3 resource file ! ! Resources common to both lines ! XBanner.DefOffset: 20 XBanner.ShadowOffset: 12 XBanner.ShowErrors: True XBanner.Font: -*-charter-bold-i-normal--76-*-*-*-p-*-iso8859-1 XBanner.ShadowColor: DarkBlue ! ! Resources for first line ! xbanner.label: This is my first line xbanner.effect: FgPlasma xbanner.fgPlasmaGrad: Red,Yellow xbanner.bgStyle: TopDown xbanner.bgGrad: Red,Yellow xbanner.barSize: 12 ! ! Resources for second line ! xb_line2.label: This is the second line xb_line2.effect: Shadowed-Outline xb_line2.shadowColor: White xb_line2.HiColor: Red xb_line2.Surround: 4Let's analyze what I am doing. The common options use the
XBanner
application class name, and resource class names.
This provides for specific overrides by the instance names. The lines
XBanner.DefOffset: 20 XBanner.ShadowOffset: 12 XBanner.ShowErrors: True XBanner.Font: -*-charter-bold-i-normal--76-*-*-*-p-*-iso8859-1 XBanner.ShadowColor: DarkBluewill set the default minimum distance from the screen edges to 20 pixels, define the shadow right- and down- offsets from the text to be 12 pixels, make both invocations of XBanner (one as
xbanner
the other as
xb_line2
) show errors / warnings if any exist, select a font, and a ShadowColor.
The next bit defines the label for the invocation as 'xbanner
' as well as the effect, the color-gradient
required by that effect, and the background style and its required color gradient.
I then define the options specific to the invocation as 'xb_line2
'. This includes overriding the ShadowColor with
its instance name, and defining Surround which is a common class.
Note: Resources are given in their instance-names, with the "XBanner.
" prefix stripped.
You may click each resource to find related resources, usage and keyword information.
The Label
The Font
The Placement On The Screen
The Effect Rendered
The Underline Feature
The Glint Feature
label
Resource
Using an empty string (e.g. XBanner.Label: " "
) is also allowed, in which case XBanner
will choose the fixed
font which is guaranteed, and force the effect
to be None
.
The label text can contain environment variables. Use $VAR_NAME
or ${VAR_NAME}
to insert the environment variable value into
the label text. To get a single $
sign, use $$
.
The above is especially useful to display the operating system name and
version without changing the resource file every time you change versions.
The following script does that in the most simplistic way, through
command-line switches, but you can use the label
resource as
well.
For sh
-style shells (sh
, ksh
, bash
...):
#!/bin/sh OSVERSION=`uname -s -r` xbanner -label '$OSVERSION'
For csh
-style shells (csh
, tcsh
...):
#!/bin/csh setenv OSVERSION `uname -s -r` xbanner -label '$OSVERSION'
font
Resourceplacement
ResourceTopLeft TopCenter TopRight Center BottomLeft BottomCenter BottomRightThe other 2 types are:
XY
This simply uses two other resources, x and y
to select the location of the top-left corner of the text's bounding-box.
CenteredOnY
This uses only the y resource to select the location of the top-line
of the text's bounding-box, and centers the line on that Y position. You might want to try running
XBanner from the command-line with -showcalc
command
line option, which displays information about the location of the top-left corner of the text's
bounding-box, and the size of the bounding-box.
x
and y
resourcesx
resource chooses where the
left side of the text's bounding box will be. The y
resource chooses where the
top line of the text's bounding box will be.
effect
ResourceEach rendering style (effect) is affected by different resources, depending on what parts of that effect can be controlled. Here is a list of the effects, each with an explanation of what it is and reference to the resources that govern its behaviour. Notice that all effects can be underlined, and therefore the underlining feature appears separately after this section.
3D-Shadow
(simple)
foreground
hiColor
- front text outline color.
shadowColor
- outline color of text beneath
front text.
shadowXOffset
/ shadowYOffset
shadows
surroundMin
/ surroundMax
Backlight
(image)
Coin
(image)
StandOut
effect, but here the text has a thin "rim" of opposite colors. The rim is always 1/3 of the
thickness
value.Fade
(image)
Backlight
only
the gradient is drawn only to pixels which are diagonally right and down from pixels of the text.FatText
(image)
FgGrad
(image)
FgPlasma
(image)
FunnyOutline
(image)
Outline
effect
only that instead of coloring outside the text we color inside the text.None
(simple)
foreground
resource to choose the color of the text.
Outline
(simple)
hiColor
resource.
Use the surroundMin/Max
resources to select the form of the outline.
PopArt
(image)
hiColor
and shadowColor
.Shadow
(simple)
Shadowed-Outline
(simple)
Outline
effect
with a shadow like in the Shadow
effect.Shake
(image)
StandIn/Out/2
(image)
StandOut
effect basically looks like Motif buttons. It makes the text seem 3D.
This is done by drawing outlines then figuring which angles need to get a light color
and which get dark. The StandIn
effect is the same with the colors inverted. The effects StandIn2
and StandOut2
are the same as their counterparts with one difference: the coloring is done into the
thickness of the font not outside it.Thick
(simple)
underlined
ResourceunderlineColor
ResourceFGC
' is recognized
and makes the underline use the same color as the foreground
color. This is good because some of the effects get rendered on the underline in this case. For
example, if you use a .foreground: green
and .underlineColor: green
in the StandOut
effect, then you will see that the text looks nice and 3D, but
the underline is a simple line. If you use the 'FGC
' keyword for the
underlineColor
then the underline will be 3D as well.
underlineThickness
Resourceglint
ResourceglintTimeMin
resource and equal or less than the glintTimeMax
resource.
The speed of appearance for each glint star is selectable through the
glintSpeed
resource. The size of each star is
selected randomly in the range glintMin
- glintMax
.
One also has control over which corners are allowed to glint through the use of the
cornerMask
resource.
glintSpeed
ResourceglintMin
/ glintMax
ResourcesglintTimeMin
/ glintTimeMax
ResourcescornerMask
ResourceSince the default is all corners, to glint only on upper-right corners you would have to use:
XBanner.cornerMask: NoDownLeft,NoDownRight,NoUpLeft
bgStyle
ResourcebgStyle
resource selects the type of background that XBanner will render. Listed
here are the allowed keywords and their related resources. Notice that all of the background styles
require the bgGrad
resource and it is
therefore not mentioned. The only exceptions are the None
, Fill
, and
BgPix
background styles.
For a complete description of the background styles, see the Resource Reference.
Here's the list of supported background style:
BgPix
.XPM
file and tiles the entire background with it. Use the
.bgPixFile
resource to set
the file name.
.bgGrad
)
Fan
Fill
.bgGrad
)
LeftDiagonal
LeftRight
LeftSplit
None
bgFill
feature).
.bgGrad
)
Plasma
.plasmaNumColors
.graininess
- sets the graininess factor.
RightDiagonal
RightSplit
Ripples
Ripples
background style are:
.ripples
- the number of ripples.
.rippleColors
TopDown
There are 2 different things you can use: bgFill
and
autoFillBg
.
bgFill
ResourcebgFillColor
resource.
autoFillBg
ResourcedoPixmap: True
and select the bgFillColor
automatically. The selection of the color is done by
simply using a color from the background's color gradient whose index is half of the number
of colors in the gradient.
The above mechanism is especially good for situations when the login box is approximately at the center of the screen, the gradient contains only 2 anchors (from one color to another, but not more), and these colors' overall brightness is not too different.
But why do that? The answer is simple. If the above conditions are met, then when the login box disappears, the resulting empty box seems to have a color gradient that is opposite that of the rest of the screen. This is a "feature" of your eyes and brain.
doPixmap
Resource.XPM
) and paste it somewhere on the screen. This handles the
XPM 'None
' color specification properly. You need to specify the file name
and the location on screen.
pixFile
ResourceIf this string begins with the '@
' character, this name is
instead interpreted as the name of a file containing a list of pixmaps to
display. Each line contains a full pathname, followed by a space, the
X
position of the pixmap, another space, and the Y
position. Nesting is not allowed, error condition checks are minimal.
pixmapX
and pixmapY
resources.
Note that these resources have no effect if you use a pixmap list-file,
since that file contains the X
and Y
positions for each pixmap listed in it.
See the pixFile
resource.
cycleColors
ResourceUse a comma separated list of the following keywords:
Backlight
.backlightGrad
.
BG
.bgGrad
.
Notice that the BgPix
, Fill
and None
background styles cannot be cycled.
Fade
.fadeGrad
.
FatText
.fatTextGrad
.
FG
.fgCycleGrad
.
The effect of this is that the entire foreground color of the text changes along a color
gradient.
FgGrad
.fgGradGrad
.
FgPlasma
.fgPlasmaGrad
.
None
.cycleSpeed
resource
divides the time that XBanner waits between consecutive cycles. Since each such wait is followed
by a check to see if freetemp
has been called, the overhead is huge. This means that
if .cycleSpeed: 2
caused the cycling speed to double, it still does not mean that
.cycleSpeed: 4
will be 4 times faster.
.reverseCycle
will be used.
But for overriding reasons a .forwardCycle
also exists.
.defXOffset
/ .defYOffset
.linger
freetemp
gets run. This option must be set to True if XBanner is generating a background for a
XDM Chooser. Using Linger or Color-Cycling implies this resource is set to True.
.showErrors
.dumpRes
.dumpResFile
resource.
Anonymous FTP is at: ftp://physics.fullerton.edu/pub/Linux/XBanner/
Other FTP sites are ftp://sunsite.unc.edu/pub/Linux/X11/xutil and all its mirror sites.
.thickness
resource are slow. Decreasing the size of
the thickness
resource helps a lot.
Coin
effect is much slower than StandOut
(and its variants) althought it is very very
similar. You should use StandOut
instead if things are too slow.
.ShadowOffset
to zero.
.surroundMin: 0
and .surroundMax: 4
and the outline color in
sharp contrast with the background color.
First, thanks to Ofer Gan and Eli Lopian without whom I would not have started learning X11 programming in the first place.
Other special thanks go to a very special friend of mine: Oren Tirosh <orenti@hiker.org.il>.
Oren has been helping me with XBanner since day one. His ideas have influenced the majority of the
code. Oren's contribution includes the StandOut
effect (and all derived work), the
Ripples
background style, and many many more.
Others who have given ideas, reported important bugs, made suggestions or contributed in other ways:
Frank Wuebbeling <wuebbel@escher.uni-muenster.de>, Marc <mwelz@cs.uct.ac.za>, Christopher Everett <ceverett@cyberramp.net>, Kyle Ferrio <kylef@engin.umich.edu>, Thilo Wunderlich <c15o@zfn.uni-bremen.de>, Rich McClellan <richmc@seneca.fullerton.edu>, Zachary Sigma Vonler <zvonler@jove.acs.unt.edu>, Chris Yeo <yeo@duke.usask.ca>, Ben Spade <bspade@asic.qntm.com>, Rubinstein Dmitry <dimrub@nsof.co.il>, Prof. Dasharath Singh <hsdsingh@hss.iitb.ernet.in>, Eric Darchis <Eric.Darchis@ping.be>, Dejan Vucinic <dejan@mit1.fnal.gov>, Landon Boyd <landon@ccn.cs.dal.ca>, Uwe Khatchikian <khatchik@buche.informatik.uni-dortmund.de>
And a few others.
Email: | amitm@doronx.iso.dec.com |
or: | amitm@netvision.net.il |
Home: | +(972)-9-917996 |
Work: | +(972)-9-593140 |
Fax: | +(972)-9-546325 Please ATTN: Amit Margalit |