Reputation: 19333
I have some simple scripts that allow me to change where certain versions of applications are used at run-time that are coded in to my .bashrc file.
For example, let's say I have the 'cat' application. There are two versions, one in /test/working and another in /test/beta.
If I run a bash command, "changer.sh", it changes the symbolic link in /bin/cat to point to either /test/beta/cat or /test/working/cat. When working in terminals and within Konsole or Xterm, this works fine.
I also have a line in my .xinitrc so that X applications can see this environment variable as well, but there is a problem: it seems that Xorg/Xfree86 de-references the symbolic link when Xorg starts up, so, for the entire duration of my Xsession, "cat" is resolved as /test/working/cat, and never re-evaluates the symbolic link if it changes later on. It seems the only workaround at this time is to close and re-start Xorg every time I change this symbolic link. Is it possible to force Xorg to reload/re-parse my .xinitrc without having to restart it each time?
Thanks!
Upvotes: 3
Views: 7370
Reputation: 7922
No, not really.
set up a bin folder with your apps:
ln -s /working/bin/cat /local/bin/cat
make .xinitrc set your desired apps to the symbolic link.
CAT=/local/bin/cat # and execue $CAT and not just cat
or
PATH=/local/bin:$PATH
that way all apps in /local/bin will be used (found) before the ones in $PATH
make your changer.sh manipulate the links in /local/bin
Upvotes: 2