man-pages/man1/xinit.1.html
2021-03-31 01:06:50 +01:00

262 lines
7.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of XINIT</TITLE>
</HEAD><BODY>
<H1>XINIT</H1>
Section: User Commands (1)<BR>Updated: xinit 1.4.1<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
xinit - X Window System initializer
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>xinit</B>
[ [
<I>client</I>
]
<I>options</I>
... ] [
<B>--</B>
[
<I>server</I>
] [
<I>display</I>
]
<I>options</I>
... ]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The <B>xinit</B> program is used to start the X Window System server and a first
client program on systems that are not using a display manager such as
<B><A HREF="/cgi-bin/man/man2html?1+xdm">xdm</A></B>(1)
or in environments
that use multiple window systems. When this first client exits,
<B>xinit</B> will kill the X server and then terminate.
<P>
If no specific client program is given on the command line,
<B>xinit</B> will look for a file in the user's home directory
called <I>.xinitrc</I> to run as a shell script to start up client programs.
If no such file exists, <B>xinit</B> will use the following as a default:
<P>
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>xterm -geometry +1+1 -n login -display :0<BR>
<P>
<P>
If no specific server program is given on the command line,
<B>xinit</B> will look for a file in the user's home directory
called <I>.xserverrc</I> to run as a shell script to start up the server.
If no such file exists, <I>xinit</I> will use the following as a default:
<P>
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>X :0<BR>
<P>
Note that this assumes that there is a program named <I>X</I> in the current
search path. The site administrator should, therefore, make a link to the
appropriate type of server on the machine, or create a shell script that
runs <B>xinit</B> with the appropriate server.
<P>
Note, when using a <I>.xserverrc</I> script be sure to ``exec'' the real X server.
Failing to do this can make the X server slow to start and exit. For example:
<P>
<TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT>exec Xdisplaytype<BR>
<P>
An important point is that programs which are run by <I>.xinitrc</I>
should be run in the background if they do
not exit right away, so that they don't prevent other programs from
starting up.
However, the last long-lived program started (usually
a window manager or terminal emulator) should be
left in the foreground so that the script won't exit (which
indicates that the user is done and that <B>xinit</B> should exit).
<P>
An alternate client and/or server may be specified on the
command line. The desired client program and its arguments should be given
as the first command line arguments to <B>xinit</B>. To specify a particular
server command line, append a double dash (--) to the <B>xinit</B> command
line (after any client and arguments) followed by the desired server command.
<P>
Both the client program name and the server program name must begin with a
slash (/) or a period (.). Otherwise, they are treated as an arguments to be
appended to their respective startup lines. This makes it possible to
add arguments (for example, foreground and background colors) without
having to retype the whole command line.
<P>
If an explicit server name is not given and the first argument following the
double dash (--) is a colon followed by a digit, <B>xinit</B> will use that
number as the display
number instead of zero. All remaining arguments are appended to the server
command line.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>EXAMPLES</H2>
Below are several examples of how command line arguments in <B>xinit</B> are
used.
<DL COMPACT>
<DT id="1"><B>xinit</B>
<DD>
This will start up a server named <I>X</I> and run the user's <I>.xinitrc</I>,
if it exists, or else start an <I>xterm</I>.
<DT id="2"><B>xinit -- /usr/bin/Xvnc :1</B>
<DD>
This is how one could start a specific type of server on an alternate display.
<DT id="3"><B>xinit -geometry =80x65+10+10 -fn 8x13 -j -fg white -bg navy</B>
<DD>
This will start up a server named <I>X</I>, and will append the given
arguments to the default <I>xterm</I> command. It will ignore <I>.xinitrc</I>.
<DT id="4"><B>xinit -e widgets -- ./Xorg -l -c</B>
<DD>
This will use the command <I>./Xorg -l -c</I> to start the server and will
append the arguments <I>-e widgets</I> to the default <I>xterm</I> command.
<DT id="5"><B>xinit /usr/ucb/rsh fasthost cpupig -display ws:1 -- :1 -a 2 -t 5</B>
<DD>
This will start a server named <I>X</I> on display 1 with the arguments
<I>-a 2 -t 5</I>. It will then start a remote shell on the machine
<B>fasthost</B> in which it will run the command <I>cpupig</I>, telling it
to display back on the local workstation.
</DL>
<P>
Below is a sample <I>.xinitrc</I> that starts a clock, several terminals, and
leaves the window manager running as the ``last'' application. Assuming that
the window manager has been configured properly, the user
then chooses the ``Exit'' menu item to shut down X.
<P>
<PRE>
xrdb -load $HOME/.Xresources
xsetroot -solid gray &amp;
xclock -g 50x50-0+0 -bw 0 &amp;
xload -g 50x50-50+0 -bw 0 &amp;
xterm -g 80x24+0+0 &amp;
xterm -g 80x24+0-0 &amp;
twm
</PRE>
<P>
Sites that want to create a common startup environment could simply create
a default <I>.xinitrc</I> that references a site-wide startup file:
<P>
<PRE>
#!/bin/sh
. /etc/X11/xinit/site.xinitrc
</PRE>
<P>
Another approach is to write a script that starts <B>xinit</B> with a specific
shell script. Such scripts are usually named <I>x11</I>, <I>xstart</I>, or
<I>startx</I> and are a convenient way to provide a simple interface for
novice users:
<P>
<PRE>
#!/bin/sh
xinit /etc/X11/xinit/site.xinitrc -- /usr/bin/X -br
</PRE>
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>ENVIRONMENT VARIABLES</H2>
<DL COMPACT>
<DT id="6"><B>DISPLAY</B>
<DD>
This variable gets set to the name of the display to which clients should
connect.
<DT id="7"><B>XINITRC</B>
<DD>
This variable specifies an init file containing shell commands to start up the
initial windows. By default, <I>.xinitrc</I> in the home directory will be
used.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="8"><I>.xinitrc</I>
<DD>
default client script
<DT id="9"><I>xterm</I>
<DD>
client to run if <I>.xinitrc</I> does not exist
<DT id="10"><I>.xserverrc</I>
<DD>
default server script
<DT id="11"><I>X</I>
<DD>
server to run if <I>.xserverrc</I> does not exist
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?7+X">X</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?1+startx">startx</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+Xserver">Xserver</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+Xorg">Xorg</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?5+xorg.conf">xorg.conf</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?1+xterm">xterm</A></B>(1)
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHOR</H2>
Bob Scheifler, MIT Laboratory for Computer Science
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="12"><A HREF="#lbAB">NAME</A><DD>
<DT id="13"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="14"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="15"><A HREF="#lbAE">EXAMPLES</A><DD>
<DT id="16"><A HREF="#lbAF">ENVIRONMENT VARIABLES</A><DD>
<DT id="17"><A HREF="#lbAG">FILES</A><DD>
<DT id="18"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="19"><A HREF="#lbAI">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:30 GMT, March 31, 2021
</BODY>
</HTML>