Question

I want to replace some utilities(like telnet) with transparent wrappers(with loggers). At first I used aliases, that worked nicely at the command line but gnome doesn't understand shell aliases so that when people would launch the utilities as the shell for a gnome-terminal profile it would run the actual utility instead of the wrapper.

Then I tried adding new folder with symlinks and prepended it to PATH(security isn't a huge concern plus its a special folder just for these symlinks) in ~/.bashrc but they still run the original(I'm guessing gnome doesn't run .bashrc since it works from the command line). Any ideas where setting path needs to go?

Was it helpful?

Solution 2

I found two ways to do this that seem to work like I want(sourcing scripts for gnome env).

First putting it in ${HOME}/.gnomerc (but I found some places that say you should manually exec gnome session afterwards and others that don't(It seems to work fine without it) and I'm afraid of breaking login.)

Putting it in ~/.profile seems to work so I just

echo 'PATH=~/.symlink_dir/:${PATH}' > ~/.profile

(note that this is ignored by bash if a ~/.bash_profile exists so you may want to manually source it from ~/.bash_profile just in case

echo 'source ~/.profile' >> ~/.bash_profile).

OTHER TIPS

Maybe update-alternatives fits your needs?

If you really want to use your replacement utilities throughout, you could put symlinks to your replacements in /usr/bin/ (or wherever as appropriate) and move the originals to /usr/bin/originals/ (or wherever).

If you do that, you'd better make sure that your wrappers are rock solid though. Depending on what you're replacing, errors might prevent booting, which is generally undesirable.

It might not be what you are asking, but have you tried changing the commands of the launchers from the menu editor.

If you are using Gnome 3 you will have to download the alacarte package.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top