Topic: Make Terminator use eLinks to open ctrl+click links
Karthik asked an interesting question over in Help & Support on how to get Terminator to use eLinks instead of Firefox as the default browser when responding to ctrl+click of a hyperlink in the terminal. The original thread provides good background and is well worth reading. After a bit of back and forth I think we've arrived at a good solution. The following is a compost of work by numerous authors on the original thread.
1) Create script to run eLinks as an x application
$ touch ~/bin/runelinks
$ gedit ~/bin/runelinksPaste the following in (thanks Karthik):
#!/bin/sh
if pgrep "^elinks$"; then
elinks -remote "openURL($*, new-tab)"
else
terminator --command="elinks $*"
fiThen save and close. Now make the script executable:
$ chmod +x ~/bin/runelinks 2) Manual override the x-www-alternative
$ sudo ln -fs ~/bin/runelinks /etc/alternatives/x-www-browserThat's it.
Explanation
Terminator uses xgd-open to respond to url clicks, more. Xgd-open uses whatever browser is set as the x-www-alternative. The above solution uses the Debian alternatives system but goes around the management script $ update-alternatives by manually setting the link, more and more.
Openbox appears to stores default browsers independent of the alternatives system; as such, overriding x-www-alternatives has a limited scope of effect. Firefox continues to work as the default browser in most GUI settings. But now when ctrl+clicking a link in Terminator the url is opened in eLinks in a new tab.
Undo
This can be reversed at any time with:
$ sudo update-alternatives --config x-www-browserMany thanks to Karthik, Iggykoopa, and Mehall
Last edited by fhsm (2009-06-22 03:05:23)