The
~/.xinitrc
file is a shell script read by xinit and by its front-end startx.
It is mainly used to execute desktop environments, window managers and other programs when starting the X server (i.e., starting daemons and setting environment variables). The
xinit program starts the X Window System server and works as first client program on systems that are not using a display manager.
One of the main functions of ~/.xinitrc is to dictate which client for the X Window System is invoked with startx or xinit programs on a per-user basis.
There exists numerous additional specifications and commands that may also be added to ~/.xinitrc as you further customize your system.