I am very (zsh)/somewhat (bash) familiar with the shell's initialization sequence when the user logs in through a text interface.
But what about the case of a "graphic login", IOW, when the user logs in through a graphic interface (e.g. through a so-called "display manager" on Linux, or the standard OS X login)?
I am particularly interested in those files (.zprofile, .zlogin, .profile) that are supposed to be sourced only for "login shells". When the login is via a text interface, this is more or less equivalent to being sourced "exactly once per session".
When the login happens through a graphic interface, it is not clear to me that there's ever a "login shell" to begin with. And even if .zprofile et al. are somehow sourced at some point as part of the graphic login sequence, it is not clear to me how the settings (e.g. exported environment variables) resulting from the sourcing of these files affect the rest of the of the session.
For example, do these settings affect the environment seen by apps that are auto-started at the time of login? Or by apps that the user starts later by clicking on desktop icons?
For that matter, what about the settings that happen in .zshenv, or in .zshrc/.bashrc1? Do they have any impact on the environment seen by "auto-started" and/or "click-started" apps?
If the answers to either of the last two question is something like "not by default", the follow-up question would be: how can one ensure that the settings performed in (at least) .zprofile/.profile, and possibly also .zlogin, get transmitted to the environment seen by all the "auto-started" and "click-started" applications?
I'm interested in the answers to these question for two shells, zsh and bash, and two operating systems, Linux and OSX.
1 assuming that .zshrc/.bashrc are being sourced as part of the zsh/bash built-in initialization sequence for "interactive" shells, rather than being sourced explicitly by .zprofile/.profile.
~/.xsessionand/etc/X11/xession. Many also parse~/.profilebut nothing. Neither~/.zprofilenor~/.bash_profilenor any other shell-specific init file is sourced for the display and "click-started" apps. However, if an application is click started via a shell (e.g. by shebang or having an Exec linesh -c "...", they will source the~/.zshrc/~/.bashrc. Confusing enough? :D