On Tue, Aug 20, 2019 at 02:27:40PM +0000, Vipul wrote: > Hi there, > > From few days, I'm trying find answer of a question "which program does > read ~/.profile if I login from graphical user interface (for ex: GNOME)?".
https://wiki.debian.org/Xsession https://wiki.debian.org/EnvironmentVariables These are, of course, incomplete. The short answer is: if you login through a Display Manager (a graphical login program), NOTHING reads ~/.profile. Ever. So, let's try to guess what the actual goal is here. If your goal is to set an environment variable in every program in your X session, and you're not using GNOME, then you can put an export command in ~/.xsessionrc and it should work great. If you are using GNOME, please find out how to do it, and then tell us, because as far as I've been able to determine, GNOME makes this completely impossible. Normal window managers run programs as children of themselves, using the standard Unix fork-and-exec model. The window manager is executed with various environment variables, umask, resource limits, and so on, and its children inherit these. So, the standard Unix login configuration stuff all works. You edit a magic dot file, you login, the dot file is read by a shell, the shell executes your window manager, the WM inherits your desired environment, and everything launched from the WM also inherits this environment. Easy peasy. But with GNOME, applications are launched by sending a message to dbus, and then dbus spawns things as *its* children. They are not children of the WM. They do not inherit the environment from the WM. They inherit the environment from dbus. And there is no known way to configure the environment of dbus in a way that is useful to end users.