.xinitrc is exectued when you explicitly run xinit (startx ultimately calls xinit)to start an X-server. Mostly this doesn't happen as current Linuxes use desktop managers, which diretly start a X-Server and then run /etc/X11/Xsession <desktopenvironment>, where <desktopenvironment> is the value of any line Exec= from a file in /usr/share/xsessions, for instance
Exec=startxfce4
if you selected XFCE as sessiontype.
On at least Debian based systems the scripts in /etc/X11/Xsession.d/ are sourced (!) in order. Mostly all these scripts set stuff up and/or modify a variable STARTUP which is eventually used in the line
exec $STARTUP
So technically you could write a /usr/share/xsession/xinitrc.desktop file which lets you select a session which will run ~/.xinitrc.
startxto start X? I don't think your.xinitrcwill be read if you are using a login manager. – phunehehe May 28 '13 at 15:38lightdm). You may want to add a start-up application instead. – phunehehe May 28 '13 at 15:48.xinitrc. In fact it is do not work for me, but I occasionally found that the.xsessionrcinstead works. – Hi-Angel Oct 12 '14 at 12:30