Thursday, January 10, 2019

xinit xsession xsessionrc notes


This is a brief on xinit xsession etc.

https://unix.stackexchange.com/questions/281858/difference-between-xinitrc-xsession-and-xsessionrc


~/.xinitrc is executed by xinit, which is usually invoked via startx. This program is executed after logging in: first you log in on a text console, then you start the GUI with startx. The role of .xinitrc is to start the GUI part of the session, typically by setting some GUI-related settings such as key bindings (with xmodmap or xkbcomp), X resources (with xrdb), etc., and to launch a session manager or a window manager (possibly as part of a desktop environment).

~/.xsession is executed when you log in in graphical mode (on a display manager) and the display manager invokes the “custom” session type. (With the historical display manager xdm, .xsession is always executed, but with modern display managers that give the user a choice of session type, you usually need to pick “custom” for .xsession to run.) Its role is both to set login-time parameters (such as environment variables) and to start the GUI session.

~/.xsessionrc is executed on Debian (and derivatives such as Ubuntu, Linux Mint, etc.) by the X startup scripts on a GUI login, for all session types and (I think) from all display managers. It's also executed from startx if the user doesn't have a .xinitrc, because in that case startx falls back on the same session startup scripts that are used for GUI login. It's executed relatively early, after loading resources but before starting any program such as a key agent, a D-Bus daemon, etc. It typically sets variables that can be used by later startup scripts. It doesn't have any official documentation that I know of, you have to dig into the source to see what works.


--30--

No comments:

Post a Comment