Loading of xinitrc,xserverrc,xresources,xdefaults,xprofile,xsession,xmodmap - Desktop Customization & Workflow
Users browsing this thread: 3 Guest(s)
|
|||
Hello nixers,
In a previous forums thread there was a discussion about certain X configuration files and their roles. Namely: xinitrc,xserverrc,xresources,xdefaults,xprofile,xsession,xmodmap. So let's try to clear up this mumbo jumbo of words. There's roughly two ways to start your X environment, one is via xinit and the other is via a display manager (fancy login screen). Depending on which one you use, different configuration files will be loaded. If starting via xinit, or startx which is a wrapper over xinit, then the ~/.xinitrc will be loaded, and if not present will load the global /etc/X11/xinit/xinitrc. This will run all the lines found in it, interpreted by /bin/sh and will stop at the last one. The X session will stop when that last program terminates. If using the globally available xinitrc it will include in an alphabetical order sub-xinitrc found in the /etc/X11/xinit/xinitrc.d/. That globally available xinitrc loads two more configurations:
xinit/startx will finally start the X server, it does it by executing a script found in ~/.xserverrc or globally /etc/X11/xinit/xserverrc. This consists of simply: Code: exec /usr/bin/X -nolisten tcp "$@" What about initiating a graphical session from the display manager. Instead of xinitrc the file loaded at login will be the Xsession file. So similar to xinitrc we have globally a default located at /etc/X11/Xsession.options along with a directory of sub-xsessions to be loaded in /etc/X11/Xsession.d. Also similar to xinit the default Xsession will load the Xresources. As for local configs there are many of them depending on what the type of session, I quote: Quote:If the user has a ~/.xsessionrc file, read it. (used by all sessions types) Some specific display manager include in their default Xsession an extra configuration called Xprofile. For example:
Otherwise, if you want the Xprofile, you have to source the file manually from startx/xinit or XDM or any other display manager. Now for something unrelated, Xdefaults is the old version of Xresources. The way it was done in the old days is that Xdefaults was read every single time a client program (Xlib) was started, unlike Xresources which have properties stored in the root window/resource manager (think xrdb). So that means the old method, Xdefaults, couldn't be used over the network because you needed direct access to the file. Now that gets a bit complicated because there could be multiple Xdefaults files found in different ways other than ~/.Xdefaults. I quote: Quote:There also is the $XENVIRONMENT variable, which defaults to ~/.Xdefaults-hostname ($XENVIRONMENT/.Xdefaults) if not set. This is used in the same way as .Xdefaults, but is always read regardless of whether RESOURCE_MANAGER is present. You can use .Xdefaults-hostname files to keep some settings machine-specific while using xrdb for the global ones Quote:The fourth location is the directory pointed to by the $XAPPLRESDIR environment variable. (Oddly, if the variable is not set, $HOME is used as the default.) When a program is started, it looks if any of the following files exist (the file name being the same as the program's class name): Quote:The fifth location is the system-wide "app-defaults" directories. Again, the app-defaults directories are checked on program startup if they have a file named after the program. For example, XTerm (on Arch Linux) uses: I hope that helps clear things up. References: https://wiki.archlinux.org/index.php/Xinit https://wiki.archlinux.org/index.php/X_resources https://wiki.debian.org/Xsession https://wiki.archlinux.org/index.php/Xprofile https://superuser.com/questions/243914/w...lts#243916 |
|||
Messages In This Thread |
Loading of xinitrc,xserverrc,xresources,xdefaults,xprofile,xsession,xmodmap - by venam - 22-04-2019, 05:26 AM
RE: Loading of xinitrc,xserverrc,xresources,xdefaults,xprofile,xsession,xmodmap - by evbo - 22-04-2019, 12:20 PM
RE: Loading of xinitrc,xserverrc,xresources,xdefaults,xprofile,xsession,xmodmap - by jkl - 22-04-2019, 06:56 PM
RE: Loading of xinitrc,xserverrc,xresources,xdefaults,xprofile,xsession,xmodmap - by z3bra - 23-04-2019, 07:45 AM
|