How to modify PATH variable for X11 during log-in?

Modify PATH variable for X11 during log-in

  • I am working on some lab computers (read: no administrative rights) that, if I log in, I need to change the PATH variable as X11 starts. The reason is that I need to change the PATH variable at this time, as opposed to later, is that the Print Screen command seems to "bind" during login (forgive my bad explanation of this). Currently, I have a .bashrc script as a workaround: #!/bin/bash export PATH=/home/username/bin:$PATH I can make it work by starting a new X, but I was wondering if it is possible to change upon login. cat /etc/redhat-release tells me my distribution is: Red Hat Enterprise Linux Client release 5.8 (Tikanga)

  • Answer:

    You can change $PATH easily for your user account (thus without admin rights). It depends on what kind of shell you have, to find the shell do: echo $SHELL, most likely you have /bin/bash(that echo $SHELL behaves funny sometimes, if so try ps). If you shell is bash, you want to modify ~/.bash_profile by adding things like: export PATH=$PATH:/path/to/something/:/path/to/something/else/ or export PATH=/path/to/something/:/path/to/something/else/:$PATH If your shell is not bash, you need to modify other files in your user directory in a slightly different way, e.g. http://tcshrc.sourceforge.net/tcsh.html for the files you need to modify for tcsh. If another shell is used (unlikely), just use your favorite search engine to check how to modify $PATH for that shell and do this in the per-user files, ~/.something. You don't need admin rights to modify these files.

user1028435 at Super User Visit the source

Was this solution helpful to you?

Other answers

add proper export to /etc/X11/Xsession file, or even better create a separate /etc/X11/Xsession.d/my_whatever file with such exports.

Michał Šrajer

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.