Skip to content
Search

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

$ sudo pacman -S xorg-xinit

xinitrc

Located at ~/.xinitrc.

X startup flow

X is usually started with xinit, startx, or XDM (X Display Manager).

  1. 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.
  2. It opens a socket on a TCP port (usually 6000), ready to listen for requests such as display commands.
  3. 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.
  4. 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.
  5. 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:

$ startx -- -keeptty &> ~/.xorg.log

See also

Favorite site

author Zer0 sitemap