STARTX(1)
๐ STARTX(1) โ like, the manual page for startx, bestie
okay so real talk: this is the startx(1) page from the General Commands Manual, and it ships with X Version 11 / xinit 1.4.4 (we'll gush about that at the end, don't worry ๐). It's the little script that could โ your glowy screen era starts here. โจ
๐ธ NAME ๐ธ
startx โ initialize an X session
like, it starts the X. that's the whole job. iconic behavior only.
๐ SYNOPSIS ๐
startx [ [ client ] options ... ] [ -- [ server ] [ display ] options
... ]
so yes, there are brackets inside brackets inside brackets. it's giving nesting doll realness ๐ช but honestly? you'll probably just type startx and move on with your life.
โจ DESCRIPTION โจ
okay so the startx script is a front end to xinit(1) โ like, xinit is the main character and startx is the hype girl who makes it presentable. it gives you a "somewhat nicer user interface" for running a single session of the X Window System. and bestie, most of the time people run it with literally no arguments at all. no cap.
Whatever arguments you put right after the startx command get used to start a client, exactly the same way xinit(1) does it. ๐
Then there's the special argument -- โ that's the bouncer at the door ๐ช it marks the end of client arguments and the beginning of server options. so anything after -- is server business. Super convenient to specify server options with startx so you can change them per-session, which is lowkey the whole point. Some examples of specifying server arguments follow โ but fr fr, consult the manual page for your X server to figure out which arguments are actually legal, because we are not out here guessing. ๐
startx -- -depth 16
startx -- -dpi 100
startx -- -layout Multihead
๐ฆ which client though?
To determine the client to run, startx goes down a checklist like it's doing a vibe check:
- first it checks the environment variable
XINITRCfor a filename. - if that variable is unset, or does not contain a filename, it looks for a file called
.xinitrcin the user's home directory. - if that's not found, it uses the file
xinitrcin the xinit library directory.
but wait โ if you gave command line client options, those override this whole behavior and it reverts to the plain xinit(1) behavior. periodt.
๐ง which server though?
Same energy for the server:
startxchecks the environment variableXSERVERRCfor a filename.- if that variable is unset, or does not contain a filename, it looks for a file called
.xserverrcin the user's home directory. - if that's not found, it uses the file
xserverrcin the xinit library directory.
and again โ if command line server options are given, they override this behavior and it reverts to the xinit(1) behavior.
ngl, users rarely need to provide a .xserverrc file. like... rarely rarely. don't make one just to feel something. ๐ซถ
See the xinit(1) manual page for more details on the arguments โ it's the source material, bestie.
The system-wide xinitrc and xserverrc files live in the /usr/libexec/xinit directory. ๐โจ
๐ what .xinitrc actually is
The .xinitrc is typically a shell script which starts many clients according to the user's preference. When this shell script exits, startx kills the server and performs any other session shutdown needed. so like, the script ending = the whole party's over ๐
Most of the clients started by .xinitrc should be run in the background (that's the &, iykyk). The last client should run in the foreground; when it exits, the session will exit. People often choose a session manager, a window manager, or an xterm as the ''magic'' client. ๐ that's the one holding the whole session together.
๐ EXAMPLE ๐
Below is a sample .xinitrc that starts several applications 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. cute, clean, and it works. ๐
xrdb -load $HOME/.Xresources
xsetroot -solid gray &
xbiff -geometry -430+5 &
oclock -geometry 75x75-0-0 &
xload -geometry -80-0 &
xterm -geometry +0+60 -ls &
xterm -geometry +0-100 &
xconsole -geometry -0+0 -fn 5x7 &
exec twm
notice how everything's got a & except that final exec twm? that's the magic client, bestie. it's the one in the foreground. ๐
๐ ENVIRONMENT VARIABLES ๐
DISPLAYโ This variable gets set to the name of the display to which clients should connect. Note that this gets set, not read. so it's output, not input. she's a giver. ๐ซถXAUTHORITYโ This variable, if not already defined, gets set to$(HOME)/.Xauthority. This is to prevent the X server, if not given the-authargument, from automatically setting up insecure host-based authentication for the local host. ๐จ like, security thing, pay attention. See theXserver(1)andXsecurity(7)manual pages for more information on X client/server authentication.XINITRCโ This variable should contain the location of anxinitrcfile. If unset,$(HOME)/.xinitrcor/usr/libexec/xinit/xinitrcwill be used.XSERVERRCโ This variable should contain the location of anxserverfile. If unset,$(HOME)/.xserverrcor/usr/libexec/xinit/xserverrcwill be used.
๐ง FILES ๐ง
$(HOME)/.xinitrcโ Client to run. Typically a shell script which runs many programs in the background.$(HOME)/.xserverrcโ Server to run. The default isX./usr/libexec/xinit/xinitrcโ Client to run if the user has no.xinitrcfile./usr/libexec/xinit/xserverrcโ Server to run if the user has no.xserverrcfile.
๐ฅ SEE ALSO ๐ฅ
xinit(1), X(7), Xserver(1), Xorg(1), xorg.conf(5)
go read them, they're literally the lore. ๐
X Version 11 ยท xinit 1.4.4 ยท STARTX(1) โ and that's the whole page, bestie!! ๐โจ you read the entire thing, I'm so proud of you. now go type startx and slay. ๐
๐๐ฆ
๐ฆ where this page comes from
- opensuse-leap 16.0: xinit 1.4.4-bp160.1.4 ยท MIT
- opensuse-leap 16.0: xinit 1.4.4-bp160.1.4 ยท MIT
- opensuse-leap 16.0: xinit 1.4.4-bp160.1.4 ยท MIT
- opensuse-leap 16.0: xinit 1.4.4-bp160.1.4 ยท MIT
- Copyright 1993, 1998 The Open Group
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms