.\" $Id: xmotd.8,v 1.11 2003/02/14 00:31:02 elf Exp $" .TH XMOTD 8 "Nov 24 1999" "X11 Release 6.4" .SH NAME xmotd \- message-of-the-day browser for X (and dumb terminals, VT100, etc.) .SH SYNOPSIS .B xmotd [\fBX-toolkit options\fP] [\fBxmotd-options\fP] \fIfile\fP [\fIfile2\fP ... ] .B xmotd [\fBX-toolkit options\fP] [\fBxmotd-options\fP] \fIdirectory\fP .PP or (in text-mode) .B xmotd [\fB-stampfile\fP \fIstamp-file\fP] [\fB-wakeup\fP \fIsleep-period\fP] \fIfile\fP [\fIfile2\fP ...] .SH DESCRIPTION .LP \fBxmotd\fP is a utility program (for X11 and dumb terminals) that can be executed during the login process to display pertinent messages (i.e. the message of the day) or to periodically check, while the user is logged in, whether one or more message files have been modified and display them if they have. Under X11, it displays a customizable bitmap in the top-left corner. It provides for up to 3 lines of title-text (the length of the text depends on the size of the font chosen). It has a \fI"Dismiss"\fP button below the bitmap and a read-only text-widget that displays the message (or messages) of the day. The date of the message (and optionally, the filename) is displayed just above the text. .LP .B xmotd can be configured to run in various modes: to always pop-up after login or to pop-up only when the motd changes; to pop-down automatically (without user-intervention) after a specified delay; to run in the background and periodically check if the motd has changed and display it. By default, .B xmotd displays a message only if the file(s) was updated since the last time the user read it. .LP If .B xmotd has to display more than one file, the user is obliged to press the \fI"Next Message"\fP button to view subsequent messages; the text of the button changes to \fI"Dismiss"\fP when the last message is displayed. .LP .B xmotd defaults to text-only mode (output to .B stdout when it cannot connect to an X display. This mode is useful for running .B xmotd from user's .I ~/.login file in cases where they can also login via dialup. .LP This version of .B xmotd cannot display messages marked-up with HTML and xpm colour pixmap logos, because the code that provided that functionality does not comply with Debian Free Software Guidelines. .SH OPERATION .LP .B xmotd is usually run from the system \fIXsession\fP file via xdm(1), CDE login and/or from the user's .I ~/.login file. At sites where xdm is not used, \fBxmotd\fP may be run from the user's .I ~/.xinitrc where a (possibly) malicious user may intentionally or accidently remove the \fBxmotd\fP invocation from the file. .LP When .B xmotd first runs, it creates a timestamp file (by default called .I .xmotd ) in the user's home-directory. On subsequent invocations, .B xmotd uses the date of this file to decide whether or not the message-of-the-day (motd) files have been updated. If the date of the motd file is later than the date on the \fI~/.xmotd\fP file, then .B xmotd will display the motd file; otherwise it will silently exit (if there are no more files to be displayed and if \fB-wakeup\fP was not used). When invoked with \fB-wakeup\fP, xmotd daemonizes itself and goes to sleep for the specified sleep-period, periodically waking-up to see if the motds have changed and then displaying them. .LP By default, .B xmotd pops-down only when the \fI"Dismiss"\fP button is clicked; the rest of the login-procedure then continues. This interactive behaviour can be overridden so .B xmotd will pop-down without user intervention, after a specified timeout period. .SH OPTIONS All the standard .B X options are valid. In addition, the following options, which may also be set as resources in the app-defaults file (See RESOURCES), are available: .TP 8 .BI \-always overrides .B xmotd default behavior; the \fI~/.xmotd\fP time-stamp is ignored and the message (or messages) is always displayed. Zero-length (empty) files are displayed when this option is specified. .TP 8 .BI \-atom " atom-name" register .B xmotd with name \fIatom-name\fP. By default, only one .B xmotd is allowed to run (per user). You can permit multiple instances of .B xmotd to run by giving each instance an unique name. .B xmotd will intern an atom with the X server, that combines the atom-name and the user's login-id (e.g. \fI"xmotd.elf"\fP ; the default atom name is \fI"xmotd"\fP); subsequent invocations of .B xmotd will check if this atom exists and exit if it does. .TP 8 .BI \-bitmaplogo " bitmap-filename" specifies that the bitmap \fIbitmap-filename\fP is to be displayed in place of the default bitmap, the "X" logo. Ideally, the specified bitmap should have a width and height of 100 pixels. If xpm support is compiled-in, xpm colour pixmaps may be substituted instead. See NOTES for additional details. .TP 8 .BI \-help displays command-line options usage. .TP 8 .BI \-paranoid (used with \fB-warnfile\fP) displays the warning message unconditionally at every login (even when there are no messages to be displayed). .TP 8 .BI \-popdown " timeout" exit or pop-down without user intervention, \fItimeout\fP seconds after being invoked. The user can dismiss \fBxmotd\fP at any time before the timeout, by clicking on the \fI"Dismiss"\fP button. This option is only valid at the initial login; it is ignored on subsequent pop-ups when \fBxmotd\fP is invoked with \fB-wakeup\fP. .TP 8 .BI \-showfilename displays the filename of the file currently being viewed (as it appears on the command-line), alongside the date. .TP 8 .BI \-stampfile " stamp-filename" overrides the default timestamp filename, \fI~/.xmotd\fP, and uses \fIstamp-filename\fP instead. .TP 8 .BI \-tail display the end of a file; the text is automatically scrolled so the end of the file is visible. .TP 8 .BI \-usedomains uses local domain-name based time-stamping in cases where user's home-directories are shared (NFS mounted) across various domains. Time-stamps are created (and checked) with appropriate domain-names appended. .TP 8 .BI \-warnfile " warning-filename" specifies a file containing a standard message used to warn users of the consequences of deviance and sundry unlawful things they should not even \fIthink\fP of doing on your network; your network's rules of use, information about disk quotas, modem charges and printer accounting fees (used with \fB-paranoid\fP). .TP 8 .BI \-wakeup " sleep-period" causes \fBxmotd\fP to run in the background and wakeup periodically every \fIsleep-period\fP hours to check whether the files have been modified and therefore need to be (re-)displayed. The sleep period is specified as a floating point number where the fractional portion indicates the number of minutes. For example, a sleep-period of 0.25 indicates 15 minutes (one quarter of an hour) and a sleep-period of 1.5 indicates one and one-half hours; the minimum (enforced) sleep-period is 1 minute. The \fB-wakeup\fP option is useful at sites where users with personal workstations never log-out. See NOTES for additional details. .TP 8 .I file [file2 ... ] one or more files to be displayed may be specified. The file(s) contain the text of the message(s) of the day. If HTML support is compiled-in the motd files should be marked-up with HTML. .TP 8 .I directory Instead of supplying one or more files on the command-line, \fBxmotd\fP may be supplied a \fIdirectory\fP containing file(s) to be displayed. \fBxmotd\fP will scan the directory and display all the files contained therein, that need to be displayed. This feature is useful when used with the \fB-wakeup\fP option; upon waking-up, \fBxmotd\fP will re-scan the directory for any files (including new files that have been subsequently added) that need to be displayed. .SH EXAMPLES .LP Give \fBxmotd\fP a geometry option to tell it to pop-up at a location other than 0,0 and read-in the message-of-the-day from the file \fI/usr/local/motd\fP: .nf xmotd -geometry +20+20 /usr/local/motd .fi .LP Use a bigger window (900x600) and automatically position it (at top-left corner at 20,20), always pop-up \fBxmotd\fP displaying the contents of \fI/usr/local/motd\fP, ignoring the user's \fI~/.xmotd\fP timestamp-file and pop-down after 20 seconds: .nf xmotd -geom 900x600+20+20 -always -popdown 20 /usr/local/motd .fi .LP Use a custom bitmap in the file \fI/usr/local/xmotd.bm\fP: .nf xmotd -geom +5+5 -bitmaplogo /usr/local/xmotd.bm /usr/local/motd .fi .LP In the following example, all the files in \fI/usr/local/messages/\fP will be checked for modification times greater than the time-stamp and only those files will be displayed and every eight and a half hours, \fBxmotd\fP will check if any files have changed (or new ones added) and display them if necessary: .nf xmotd -geom +5+5 -wakeup 8.5 /usr/local/messages/ .fi To display a warning-message every time the user logs-in (even when no messages need to be displayed), and to display the filenames of the files being viewed, use: .nf xmotd -geom +5+5 -warnfile /usr/local/WARNING -paranoid \\ -showfilename /usr/local/motds/ .fi X resources may be changed from the command-line using the \fB-xrm\fP option. This example (typed as a single line) illustrates how \fBxmotd\fP can be customized exclusively from the command-line: .nf xmotd -always \\ -xrm "*title.label: Top 10 Disk Hogs\\n As of midnight\\n " \\ -xrm "*title.foreground: yellow" \\ -xrm "*form.background: red" \\ -xrm "*title.background: red" \\ -xrm "*logo.background: pink" \\ -xrm "*text*font: -adobe-times-bold-*-normal-*-*-180-*" \\ -geometry 500x650-1-1 \\ -bitmaplogo /usr/common/choke.xbm -popdown 10 \\ /usr/common/accounting/top & .fi .SH RESOURCES editres(1) may be used to edit resources. The application class-name is \fIXMotd\fP. .LP The resource: \fIXMotd*Always\fP (set to either \fBTrue\fP or \fBFalse\fP) is equivalent to the \fB-always\fP command-line option. .LP The resource: \fIXMotd*Atom\fP (set to the name of the atom \fBxmotd\fP is registered with) is equivalent to the \fB-atom\fP command-line option. .LP The resource: \fIXMotd*BitmapLogo\fP (set to the path and filename of the bitmap/pixmap-file) is equivalent to the \fB-bitmaplogo\fP command-line option. .LP The resource: \fIXMotd*Browser\fP (set to the path and filename of the browser to be used when users click on an URL (HTML version only)) is equivalent to the \fB-browser\fP command-line option. .LP The resource: \fIXMotd*Paranoid\fP (set to \fBTrue/False\fP) is equivalent to the \fB-paranoid\fP command-line option. .LP The resource: \fIXMotd*Popdown\fP (set to the number of seconds) is equivalent to the \fB-popdown\fP command-line option. .LP The resource: \fIXMotd*UseDomains\fP (set to \fBTrue/False\fP) is equivalent to the \fB-usedomains\fP command-line option. .LP The resource: \fIXMotd*ShowFilename\fP (set to \fBTrue/False\fP) is equivalent to the \fB-showfilename\fP command-line option. .LP The resource: \fIXMotd*Warnfile\fP (set to the path and filename of the warning-file) is equivalent to the \fB-warnfile\fP command-line option. .LP The resource: \fIXMotd*Tail\fP (set to \fBTrue/False\fP) is equivalent to the \fB-tail\fP command-line option. .LP The resource: \fIXMotd*Wakeup\fP (set to an floating-point number representing hours) is equivalent to the \fB-wakeup\fP command-line option. .LP The resource: \fIXMotd*title.label\fP (set to a possibly multi-line string) may be used to customize the title. By default, the title is the single line:\fI"Message Of The Day\\n\\n\\n"\fP (the 2-character sequence, \fI"\\n"\fP, indicates a carriage-return). For example, if you want a 2 line title that reads: .nf This is the Message of the Day .fi the resource can be specified as: .nf *title.label: \\ This is the\\nMessage of the Day\\n\\n .fi Note that the first backslash quotes the leading spaces that indent the words, \fB"This is the"\fP. .SH WIDGET HIERARCHY The widget hierarchy is as follows (Class-name & object-name): .nf .ta .5i 1.0i 1.5i 2.0i XMotd xmotd Form form Label logo Label title Label hline Label info Command quit Text text \fBOR\fP Html text .fi .SH FILES \fI$ProjectRoot/lib/X11/xdm/Xsession\fP (where \fI$ProjectRoot\fP is \fB/usr/X11R6\fP or, perhaps \fB/usr/X11\fP). For systems running CDE put a script that invokes \fBxmotd\fP in \fI/etc/dt/config/Xsession.d/\fP \fI$HOME/.xmotd\fP (default timestamp filename) \fI$HOME/.login\fP .TE .SH SEE ALSO .BR X(1), .BR xdm(1), .BR editres(1), .BR login(1), .BR xv(l), .BR gimp(l), .BR xpaint(l), .BR cat(1), .BR less(l) .SH NOTES The \fB-always\fP option is considered fascist; it is provided merely for completeness and for testing purposes. If xpm support is compiled-in, \fBxmotd -help\fP will print the words \fI"bitmap/pixmap"\fP for the \fB-bitmaplogo\fP description instead of just \fI"bitmap"\fP. Under dumb-terminal mode, all command-line options are ignored with the exception of \fB-stampfile\fP and \fB-wakeup\fP; the \fB-always\fP option is equivalent to cat'ing the motd from the \fI~/.login\fP file; and \fB-popdown\fP is not really relevant. Both \fB-warnfile\fP and \fB-paranoid\fP may be simulated with appropriate cat(1) and more(1) commands. \fBxmotd\fP processes invoked with \fB-wakeup\fP will continue sleeping, "S" in the ps(1) status field, after the user has logged-out until the sleep timeout expires. Only when \fBxmotd\fP wakes-up, will it detect that the user has logged-out and exit. \fBxmotd\fP's logout-detection routine relies on the xdm(1) support scripts \fBGiveConsole\fP (which chown's \fB/dev/console\fP to the user) and \fBTakeConsole\fP (which chown's \fB/dev/console\fP back to root) setting the correct permissions and ownership on \fB/dev/console\fP. When \fBxmotd\fP wakes-up, it attempts to open(2) \fB/dev/console\fP for reading; if this open fails, it is an indication that the user has logged out because \fBTakeConsole\fP has changed ownership of the console. .SH BUGS There are no provisions for displaying embedded images in the HTML version of \fBxmotd\fP (until a stable XmHTML widget is available, or perhaps when \fBxmotd\fP is ported to the GTK). At least one other. .SH QUOTES .nf \fI...and our lives are forever changed we will never be the same the more you change the less you feel\fP --\fBTonight, tonight\fP, "Mellon Collie And The Infinite Sadness" Billy Corgan, The Smashing Pumpkins \fIOmnia mutantur, nos et mutamur in illis. (All things change, and we change with them).\fP --Matthias Borbonius: \fBDeliciae Poetarum Germanorum\fP, i. 685 \fITo everything there is a season, And a time to every purpose under heaven.\fP --Ecclesiastes 3:1-4 .fi .SH AUTHORS Luis Fernandes is the primary author and maintainer. Richard Deal contributed the directory-scanning code. Stuart A. Harvey contributed the URL support code for the HTML version. David M. Ronis contributed code to support xpm logos. .SH COPYRIGHT Copyright 1993 (as xbanner, no public release) Copyright 1994-97, 1999, 2001, 2003 Luis A. Fernandes Permission to use, copy, hack, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This application is presented as is without any implied or written warranty. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The HTML widget Copyright 1993, Board of Trustees of the University of Illinois. See the file libhtmlw/HTML.c for the complete text of the NCSA copyright. NOTE: THE HTML WIDGET IS NOT DISTRIBUTED IN THE "LITE" VERSION OF THE xmotd DISTRIBUTION, WHICH IS THEREFORE FULLY COMPLIANT WITH THE GPL.