I am writing a python/pygtk application that is adding some custom scripts (bash) in a certain folder in $HOME (eg. ~/.custom_scripts).
I want to make that folder available in $PATH. So every time the python app is adding the script, that script could be instantly available when the user is opening a terminal (eg. gnome-terminal).
Where do you suggest to “inject” that $PATH dependecy ? .bashrc, /etc/profile.d, etc. ?
What advantages / disadvantages I might encounter ?
For example if i add a script to export the new path in /etc/profile.d, the path is not being updated until I re-login.
Thanks
~/.bashrc is read every time gnome-terminal is opened, (assuming the user has SHELL set to /bin/bash).
Be sure to check os.environ[‘PATH’] to see if the directory has already been added, so that the script doesn’t add it more than once.