karthik wrote:Reading the xdg-open (which as mentioned above, is what terminator uses to open URLs) man page did not provide any answers either.
I don't think xdg-open is the place to start trying to solve your problem. It's only important because it shows that terminator really wants to launch an x app in response to a url click. Terminator (terminatorterm.py) uses xgd-open to open URLs. I don't think xdg-open can be configured. So your first option is to hack xdg-open out of terminator and replace it with custom url handling. If you really know what you are doing this may get you better results in the end, but it takes you totally off the reservation with terminator moving forward.
The second option is to work with xdg-open's behavior. xdg-open is going to look to see what you have set for x-www-browser and launch that with the url terminator passes. The x-www-browser alternative is a sym links in /etc/alternatives set by update-alternatives (which is a perl script in sbin if you want look under the covers). This has to be an x application so no matter what you do I don't think you can set elinks as your x-www-browser directly. Instead you are going to need to get at elinks via a shell script that runs elinks in a new emulator window. Something as simple as the following should get the job done:
#!/bin/sh
terminator --command="elinks $1"
To get xdg-open to do what you want, you need to do is register elinks/launcher script as a the x-www-browser alternative. I've never added an alternative manual, but I can think of a couple of possibilities for getting elinks listed as the x-www-browser:
1)You could manually set the symlink. I don't know how update-alternatives "manages" /etc/alternatives, the script might respond poorly to having you go behind its back, but it may not.
2) You could try using update-alternatives --set. Maybe you can make elinks the x-www-browser even though it's not on the list.
3) You can try adding it to the list. Doing so on the cli is involved however you can use the galternatives gui for it. If you want to try and add it from the cli you can read about it here or here (bottom of the page).
The downsides to this second sort of solution is that you'll spawn a new emulator window for each link and that your system wide default browser will now be elinks running in an emulator.
As an aside you have a non-x browser alternative (www-browser) that can be set. Mine is elinks by default. You can check this with sudo update-alternatives --config www-browser , note the lack of an x in front of www-browser. This point is really academic as xdg-open isn't going to look at this option.
Bottom line: I'd see two options, hacking terminator to respond to links with something other than xdg-open or registering a shell script that runs elinks in an emulator as the systems x-www-browser.
FHSM: avoid vowels and exotic consonants and you'll get your handle every time.
identi.ca