Web lists-archives.com

Re: Ideal place to set environment variables




Hi Ben,

Under XFCE, I have ~/.config/xfce4/xinitrc something like this:

#!/bin/sh
export LC_COLLATE=C
export PATH=$HOME/bin:$PATH
export QT_QPA_PLATFORMTHEME=gtk2
export GTK_OVERLAY_SCROLLING=0
umask 007
. /etc/xdg/xfce4/xinitrc
Thanks for telling me this. Since I also use Xfce, it makes sense for me to go this route. Can you tell me where I can read more about this file preferably in the context of Xfce?

Thanks,
Subhadip

On Tuesday 20 March 2018 03:23 AM, Ben Caradoc-Davies wrote:
On 20/03/18 07:59, Subhadip Ghosh wrote:
While it was very informative, it was not evident from it that what
the standard or preferred place is for setting an environment variable
if I want it to be available from both graphical applications as well as
from terminal (bash).

Under XFCE, I have ~/.config/xfce4/xinitrc something like this:

#!/bin/sh
export LC_COLLATE=C
export PATH=$HOME/bin:$PATH
export QT_QPA_PLATFORMTHEME=gtk2
export GTK_OVERLAY_SCROLLING=0
umask 007
. /etc/xdg/xfce4/xinitrc

Graphical applications (including xfce4-teminal) and its child bash inherit these exported environment variables from their parent. (And note that I assume $PATH and $HOME do not require quoting.)

The file is a script so it must be executable:
chmod 700 ~/.config/xfce4/xinitrc

Kind regards,