← Previous → Next Contents

Girl feeding gulls

Customizing XTide

XTide is customized by changing its settings.  The most convenient way to do this is generally through the control panel that is documented in a previous section.  However, you can also change these settings in config.hh, in your X resources database, or on the command line.  The order of precedence, from least significant to most significant, is:

  1. config.hh
  2. Xdefaults (X resources)
  3. ~/.xtide.xml (control panel)
  4. command line

Note that only xtide (not xttpd or tide) reads Xdefaults.

Canonically, all command line settings take the form -xx value, with a space between the switch and the supplied value.  The yes-or-no settings get a value of "y" or "n".  However, XTide understands the following syntactic shortcuts:

Some shorthand forms are ambiguous.  For example, -lw5 could mean "set the line width to 5" (-lw 5) or it could mean "load the location named w5" (-l w5).  If this happens, you will get an error and will need to spell out what you meant.

Be aware that older versions of XTide will not support all of the documented settings.

XTide*background
Background color for text windows and location chooser.
Default: white
Command line: -bg
config.hh: bgdefcolor
.xtide.xml: <xtideoptions bg="white"/>
XTide*buttoncolor
Background color of buttons.
Default: gray80
Command line: -bc
config.hh: buttondefcolor
.xtide.xml: <xtideoptions bc="gray80"/>
XTide*caldayfmt
(New in XTide 2.14)  Strftime style format string for printing days in calendars.
Default: %a %d
Command line: -cf
config.hh: caldayfmt
.xtide.xml: <xtideoptions cf="%a %d"/>
XTide*cbuttons
Create tide clocks with buttons? (y/n)
Default: n
Command line: -cb
config.hh: cbuttons
.xtide.xml: <xtideoptions cb="n"/>
XTide*cheight
Initial height for tide clocks.
Default: 312
Command line: -ch
config.hh: defcheight
.xtide.xml: <xtideoptions ch="312"/>
XTide*currentdotcolor
Color of dots indicating current stations in the location chooser.
Default: rgb:00/A0/00
Command line: -cc
config.hh: currentdotdefcolor
.xtide.xml: <xtideoptions cc="rgb:00/A0/00"/>
XTide*cwidth
Initial width for tide clocks.
Default: 84
Command line: -cw
config.hh: defcwidth
.xtide.xml: <xtideoptions cw="84"/>
XTide*datefmt
Strftime style format string for printing dates.  For calendars see caldayfmt.
Default: %Y-%m-%d
Command line: -df
config.hh: datefmt
.xtide.xml: <xtideoptions df="%Y-%m-%d"/>
XTide*datumcolor
Color of datum line in tide graphs. [*]
Default: white
Command line: -Dc
config.hh: datumdefcolor
.xtide.xml: <xtideoptions Dc="white"/>
XTide*daycolor
Daytime background color in tide graphs.
Default: SkyBlue
Command line: -dc
config.hh: daydefcolor
.xtide.xml: <xtideoptions dc="SkyBlue"/>
XTide*ebbcolor
Foreground in tide graphs during outgoing tide.
Default: SeaGreen
Command line: -ec
config.hh: ebbdefcolor
.xtide.xml: <xtideoptions ec="SeaGreen"/>
XTide*eventmask
Events to suppress (p = phase of moon, S = sunrise, s = sunset, M = moonrise, m = moonset), or x to suppress none.  E.g, to suppress all sun and moon events, set eventmask to the value pSsMm.
Default: x
Command line: -em
config.hh: eventmask
.xtide.xml: <xtideoptions em="x"/>
XTide*extralines
Draw datum and middle-level lines in tide graphs? (y/n) [*]
Default: n
Command line: -el
config.hh: extralines
.xtide.xml: <xtideoptions el="n"/>
XTide*flatearth
Prefer flat map to round globe location chooser? (y/n)
Default: n
Command line: -fe
config.hh: flatearth
.xtide.xml: <xtideoptions fe="n"/>
XTide*floodcolor
Foreground in tide graphs during incoming tide.
Default: Blue
Command line: -fc
config.hh: flooddefcolor
.xtide.xml: <xtideoptions fc="Blue"/>
XTide*font
Font used for button labels and verbiage in text windows. [**]
Default: as incoming from X11 or libXaw3dXft
Command line: -fn
config.hh: N/A
.xtide.xml: N/A
XTide*foreground
Color of text and other notations.
Default: black
Command line: -fg
config.hh: fgdefcolor
.xtide.xml: <xtideoptions fg="black"/>
XTide*gaspect
Initial aspect for tide graphs and clocks.
Default: 1.0
Command line: -ga
config.hh: defgaspect
.xtide.xml: <xtideoptions ga="1.0"/>
XTide*gheight
Initial height for tide graphs.
Default: 312
Command line: -gh
config.hh: defgheight
.xtide.xml: <xtideoptions gh="312"/>
XTide*globelongitude
Initial center longitude for location chooser.  If GPS support is present and working, this setting is redundant.
Valid values: -180 -150 -120 -90 -60 -30 0 30 60 90 120 150 360
360 will pick the longitude with the most tide stations.
Default: 360
Command line: -gl
config.hh: defgl
.xtide.xml: <xtideoptions gl="360"/>
XTide*graphfont
Font used in graphs and clocks in interactive client.  Does not affect tide, xttpd, or SVG-format output. [**]
Default: "embedded"
Command line: -gf
config.hh: defgraphfont
.xtide.xml: <xtideoptions gf="embedded"/>
XTide*graphstyle
Style of graphs and clocks.
Valid values: d (default), l (line), s (semitransparent).
Default: d
Command line: -gs
config.hh: defgraphstyle
.xtide.xml: <xtideoptions gs="d"/>
XTide*graphtenths
Label tenths of units in tide graphs? (y/n)
Default: n
Command line: -gt
config.hh: graphtenths
.xtide.xml: <xtideoptions gt="n"/>
XTide*gwidth
Initial width for tide graphs.
Default: 960
Command line: -gw
config.hh: defgwidth
.xtide.xml: <xtideoptions gw="960"/>
XTide*hourfmt
Strftime style format string for printing hour labels on time axis.
Default: %l
Command line: -hf
config.hh: hourfmt
.xtide.xml: <xtideoptions hf="%l"/>
XTide*infer
Use inferred values for some constituents.  For expert use only.
Default: n
Command line: -in
config.hh: infer
.xtide.xml: <xtideoptions in="n"/>
XTide*linebreak
(New in XTide 2.14)  Linebreak before prediction value in calendars? (y/n)
Default: n
Command line: -lb
config.hh: linebreak
.xtide.xml: <xtideoptions lb="n"/>
XTide*lwidth
Width of line in graph styles l and s (pixels, positive real number).
Default: 2.5
Command line: -lw
config.hh: deflwidth
.xtide.xml: <xtideoptions lw="2.5"/>
XTide*markcolor
Color of mark line in graphs.
Default: red
Command line: -mc
config.hh: markdefcolor
.xtide.xml: <xtideoptions mc="red"/>
XTide*monofont
Monospace font used for location list, text predictions, help windows and about mode text. [**]
Default: "-misc-fixed-medium-r-normal--13-100-100-100-c-70-iso8859-1" (without libXaw3dXft) or "LiberationMono-12" (with libXaw3dXft)
Command line: -mf
config.hh: defmonofont
.xtide.xml: <xtideoptions mf="LiberationMono-12"/>
XTide*mslcolor
Color of middle-level line in tide graphs. [*]
Default: yellow
Command line: -Mc
config.hh: msldefcolor
.xtide.xml: <xtideoptions Mc="yellow"/>
XTide*nightcolor
Nighttime background color in tide graphs.
Default: DeepSkyBlue
Command line: -nc
config.hh: nightdefcolor
.xtide.xml: <xtideoptions nc="DeepSkyBlue"/>
XTide*nofill
Deprecated.  Use graphstyle instead.
Default: n
Command line: -nf
config.hh: N/A (use graphstyle)
.xtide.xml: <xtideoptions nf="n"/>
XTide*nosunmoon
Deprecated.  Use eventmask instead.
Default: n
Command line: -ns
config.hh: N/A (use eventmask)
.xtide.xml: <xtideoptions ns="n"/>
XTide*omitunits
(New in XTide 2.14)  Print numbers with no ft/m/kt? (y/n)  Where possible, adds a header line stating the units and datum.
Default: n
Command line: -ou
config.hh: omitunits
.xtide.xml: <xtideoptions ou="n"/>
XTide*pagebreak
(New in XTide 2.14)  Pagebreak and header before every month of a calendar? (y/n)
Default: y
Command line: -pb
config.hh: pagebreak
.xtide.xml: <xtideoptions pb="y"/>
XTide*pageheight
Nominal length of paper in LaTeX output (mm). This need not match your actual paper; use "Shrink oversized pages" in print options.
Default: 420
Command line: -ph
config.hh: defpageheight
.xtide.xml: <xtideoptions ph="420"/>
XTide*pagemargin
Nominal width of top, bottom, left and right margins in LaTeX output (mm). Actual width will depend on print scaling.
Default: 10
Command line: -pm
config.hh: defpagemargin
.xtide.xml: <xtideoptions pm="10"/>
XTide*pagewidth
Nominal width of paper in LaTeX output (mm). This need not match your actual paper; use "Shrink oversized pages" in print options.
Default: 297
Command line: -pw
config.hh: defpagewidth
.xtide.xml: <xtideoptions pw="297"/>
XTide*predictinterval
Number of days of predictions to generate when no end time is specified.
Default: 4
Command line: -pi
config.hh: defpredictinterval
.xtide.xml: <xtideoptions pi="4"/>
XTide*tidedotcolor
Color of dots indicating tide stations in the location chooser.
Default: red
Command line: -tc
config.hh: tidedotdefcolor
.xtide.xml: <xtideoptions tc="red"/>
XTide*tideopacity
Opacity of the fill in graph style s (semitransparent).
Default: 0.65
Command line: -to
config.hh: deftideopacity
.xtide.xml: <xtideoptions to="0.65"/>
XTide*timefmt
Strftime style format string for printing times.
Default: %l:%M %p %Z
Command line: -tf
config.hh: timefmt
.xtide.xml: <xtideoptions tf="%l:%M %p %Z"/>
XTide*toplines
Draw depth lines on top of tide graph? (y/n)
Default: n
Command line: -tl
config.hh: toplines
.xtide.xml: <xtideoptions tl="n"/>
XTide*ttyheight
Height of ASCII graphs and clocks (characters).
Default: 24
Command line: -th
config.hh: defttyheight
.xtide.xml: <xtideoptions th="24"/>
XTide*ttywidth
Width of text format (characters).
Default: 79
Command line: -tw
config.hh: defttywidth
.xtide.xml: <xtideoptions tw="79"/>
XTide*units
Preferred units of length: ft, m, or x (no preference).
Default: x
Command line: -u
config.hh: prefunits
.xtide.xml: <xtideoptions u="x"/>
XTide*zulu
Coerce all time zones to UTC? (y/n)
Default: n
Command line: -z
config.hh: forceZuluTime
.xtide.xml: <xtideoptions z="n"/>

[*] The National Ocean Service (NOS) defines both Mean Sea Level (MSL) and Mean Tide Level (MTL) in terms of averages taken over observations.  The middle-level line is drawn at the midpoint of the theoretical tidal range, which usually corresponds to the mathematical mean level of the predictions.  This approximates both MSL and MTL, but, strictly speaking, is equivalent to neither.  Moreover, subordinate station offsets may shift the actual mean so that it no longer falls at the midpoint of the tidal range.  The datum line is drawn at the zero level of the predictions, which usually corresponds to the station's benchmark, but this too can be rendered inaccurate by subordinate station offsets.

[**] Important usage note:  If XTide is built with Xaw3dXft, font names given to XTide must be in fontconfig format (e.g., "Helvetica-10"), rather than the traditional XLFD (e.g., "-*-helvetica-*-r-*-*-10-*-*-*-*-*-*-*").  Also, Xaw3dXft does not return errors if there are problems with a font name; it just loads a default font instead.

Format of ~/.xtide.xml

If you have compiled the interactive client (xtide), then you do not need to worry about ~/.xtide.xml at all, because the control panel will configure it for you automatically.

In the event that you cannot use xtide but still need to make some settings for the command line client, use the example below as the starting point for your ~/.xtide.xml file.  This example just sets the TTY geometry.  You can add more settings by adding more attributes (like the tw and th attributes shown here) to the xtideoptions entity.  The attributes that are recognized for each setting are documented above.

<?xml version="1.0"?>
<xtideoptions tw="79" th="24"/>

Locale and terminal settings

Internally, XTide uses the Latin-1 (a.k.a. ISO-8859-1) character set exclusively.  When generating output in text or HTML formats, XTide will convert Latin-1 characters to UTF-8 if that is what the POSIX locale asks for.  This can be controlled with the LANG environment variable; e.g., LANG=en_US.UTF-8.  Any other setting of the codeset portion of LANG (which has the format lang[_terr[.codeset]]) will result in Latin-1 characters being passed through unchanged.  (CP437 is supported for DOS compatibility, but is rejected by Linux setlocale.)

If the environment variable TERM is set to vt100 or vt102, XTide will take it seriously and invoke the DEC Special Graphics character set in text format output.  Below is a comparison of how graph mode, text format looks in an xterm normally (left) and with TERM set to vt100 (right).  A VT100 provides five different horizontal line characters, which allow depth lines to be drawn more accurately.  On the downside, it does not provide any of the accented characters from Latin-1, so non-ASCII characters in location names and other data received from the harmonics file will do something weird.


← Previous → Next Contents