You are not logged in.
i'm sure i have asked this before but i cannot find it.
i want to change environment variable PATH when Xfce starts up to add another bin directory to PATH so that anywhere commands are run it can look in that directory. i want every process to inherit this new PATH.
because of many Ubuntu packages putting files in /usr/local and my own local files rebuilding its bin subdirectory from scratch, i have moved local stuff from /usr/local to the created name /usr/host (so i am adding /usr/host/bin and /usr/host/sbin to PATH) to make it easier to do. but that means adding those subdirectories to PATH everywhere (that i want to run my own commands or override an existing with the /usr/host subdirectories being up front).
i recall there was some script being run to start Xfce. but, i cannot find such a thing. does anyone know where this happens?
Last edited by Skaperen (2019-07-11 20:39:15)
Offline
Are you using bash? If so, putting your
export PATH=$PATH:/directory
command into ~/.bashrc might be a good idea.
Regards,
MDM
Offline
that only effects the terminal bash sessions, not the Xfce processes. i already have that in my big 600+ line .bashrc script.
Offline
some lines from my ~/.bashrc file:
[[ -n "${USER}" ]] || USER=$(exec whoami)
export USER
case "${USER}" in
(root|admin|admini)
suffix=( {cmd,bin,pgm} )
;;
(*)
suffix=( {cmd,bin,pgm,games,scripts} )
;;
esac
path=""
prefix=( {${HOME}/,/usr{/host/,/local/,/},/}{s,.,} )
for p in "${prefix[@]}";do
for s in "${suffix[@]}";do
if [[ -d "$p$s" && -x "$p$s" ]];then
path="$path:$p$s"
fi
done
done
export PATH="${path:1}"
Offline
Take a look at this thread .
Or man 5 Xsession.
Offline
Take a look at this thread .
Or man 5 Xsession.
thanks! it looks like /etc/X11/Xsession is the place. several other environment variables are already set there.
Offline
Greetings!
Though you've [Solved} your spec already, the following solution might come in handy at some point, or might help someone else. Based on a suggestion i read a while ago (can't recall where) I've added (as root) my own system-wide/global variables to the /etc/environment file. Worked like a charm for me.
Cheers, m4a
Linux Mint 21.3 -- xfce 4.18 ... Apple iMAC -- Lenovo, Dell, HP Desktops and Laptops -- Family & Community Support
Offline
Based on a suggestion i read a while ago (can't recall where) I've added (as root) my own system-wide/global variables to the /etc/environment file. Worked like a charm for me.
I don't test your suggestion but it seem really more easy.
Tanks.
Offline
yeah /etc/environment seems sensible. i'll add mine there, too.
Offline
[ Generated in 0.009 seconds, 8 queries executed - Memory usage: 546.97 KiB (Peak: 547.81 KiB) ]