Xinit
lastmod 2020-09-05created 2020-07-199 edits
xinit is typically used to start window managers or desktop environments. You can also use xinit to run GUI applications without a window manager, but many graphical applications require an EWMH-compliant window manager. A display manager starts Xorg and generally sources xprofile.
The xinit program lets you start the Xorg display server manually. The startx script is a front end for xinit(1).
Installation
xinitrc
Located at ~/.xinitrc.
X startup flow
X is usually started with xinit, startx, or XDM (X Display Manager).
- The X program (
/usr/bin/X) runs, or is already running in the background.- X finds the configuration file (
/etc/X11/xorg.conf), reads the settings for the graphics board and so on, and initializes them.
- X finds the configuration file (
- It opens a socket on a TCP port (usually 6000), ready to listen for requests such as display commands.
- An application (X client) is run on that terminal or on a remote terminal.
- Every X application specifies the terminal to display on by pointing to the IP address of the X server to display on.
- The application opens the X server's listening socket over the network.
- If it cannot connect, the cause may be that the X server is not running, or that the remote terminal that launched the application belongs to a host that is not permitted.
- The application exchanges X protocol messages and shows the results on the display.
Session log redirection
When Xorg is run in rootless mode, Xorg logs are saved to ~/.local/share/xorg/Xorg.log. However, the stdout and stderr output from the Xorg session is not redirected to this log. To re-enable redirection, start Xorg with the -keeptty flag and redirect the stdout and stderr output to a file: