Modify PATH variable for X11 during log-in

1

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)

user1028435

Posted 2012-04-11T03:31:55.787

Reputation: 33

Answers

0

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. tcsh shell commands 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.

lupincho

Posted 2012-04-11T03:31:55.787

Reputation: 1 630

0

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

Posted 2012-04-11T03:31:55.787

Reputation: 2 495

Hi Michal, I'm afraid that I don't have permissions to make changes to that directory. :( Looks like admin. rights are needed. – user1028435 – 2012-05-01T21:38:34.587