Can someone point me to an authoritative guide to the X11 initialization sequence that also explains how it dovetails with the shell's initialization?

I'm trying to figure out how to make some environment variables available to programs that I normally start via a desktop launcher.

But when I try to determine the order of events after I log in, and in particular, what sources what, it's like going "down the rabbit hole": every alleged guide I find through Google tells me a different story. (To make matters worse, one of the pages I found said that this order of events "depends on the distribution". I fervently hope and pray that this is not true.) At any rate, none of them is particularly clear on the relationship between the sourcing of shell initialization files (in my case, .zshenv and friends) and the rest of the X11-related initialization.

  • 1
    I have zero experience here, but if you're just looking for what spawns what, you may be able to generate a mapping function via the output of strace -f startx
    – Brandon D
    Jan 15, 2016 at 2:27
  • 1
    There is a close reason "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications).". You may want to edit to put yourself firmly into one camp or another here. Jan 15, 2016 at 4:23
  • @MichaelHomer: I'll delete my question as soon as I can.
    – kjo
    Jan 15, 2016 at 4:35
  • I didn't say you should delete it, just edit so that it clearly fits in (either seeking official documentation, or asking something concrete here). At the moment it's a bit ambiguous. Jan 15, 2016 at 4:37
  • 2
    this is an excellent question. it is my hope that no one will vote to close it on those grounds - though it is possible someone might - mh thought so anyway. ill vote to keep it open - id like to know the answer. i think perhaps mh was commenting for the same reason i am - this question has a lot of potential and shouldnt be deleted. to guard against it maybe you could find another way to phrase it that would prevent its doing so? for me, at least? i want the answer!
    – mikeserv
    Jan 15, 2016 at 10:27

1 Answer 1


The arch wiki pages are a decent starting point for most of the confusing stuff here. You could start at: https://wiki.archlinux.org/index.php/xinitrc for example.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .