SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2009-04-26 20:16:43

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Clicking links in Terminator [SOLVED]

Last edited by karthik (2009-04-28 05:48:36)

Offline

Be excellent to each other!

#2 2009-04-26 21:01:00

Mehall
#! Die Hard
From: Scotland, Cold
Registered: 2009-01-17
Posts: 850
Website

Re: Clicking links in Terminator [SOLVED]

it's based on the default browser for your system I'm afraid, so changing it will make clicking on ANY link outside of a browser load up in the browser you set. (Obv clicking a link inside firefox will always open in Firefox wink

I forget the command I'm afraid, but it's something like "sudo update-alternatives --config x-www-browser" or something.

Offline

#3 2009-04-26 21:01:01

fhsm
#! Junkie
From: New Hampshire, USA
Registered: 2009-01-05
Posts: 445

Re: Clicking links in Terminator [SOLVED]

sudo update-alternatives --config x-www-browser

Last edited by fhsm (2009-04-26 21:02:18)

Offline

#4 2009-04-26 21:03:24

Mehall
#! Die Hard
From: Scotland, Cold
Registered: 2009-01-17
Posts: 850
Website

Re: Clicking links in Terminator [SOLVED]

Beat you by a second fhsm!! And I got the command right as a long-distance recall!!! big_smile

Offline

#5 2009-04-26 21:49:29

fhsm
#! Junkie
From: New Hampshire, USA
Registered: 2009-01-05
Posts: 445

Re: Clicking links in Terminator [SOLVED]

Offline

#6 2009-04-27 04:23:33

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Clicking links in Terminator [SOLVED]

Thank you, mehall, fhsm.

Trying to run update-alternatives gives:

There are 2 alternatives which provide `x-www-browser'.

  Selection    Alternative
-----------------------------------------------
 +        1    /usr/bin/dillo
*         2    /usr/bin/firefox-3.0

Press enter to keep the default[*], or type selection number: 

Neither of which suit my purpose. I want it to run

terminator --command elinks %

when a link is clicked. I could make a short script with the above command, but how do I get update-alternatives to recognize this as one of the x-www-browser alternatives?

Offline

#7 2009-04-27 05:36:10

iggykoopa
Script Master
Registered: 2008-12-13
Posts: 1,486

Re: Clicking links in Terminator [SOLVED]

not sure how to make it recognize it, but I can tell you why it doesn't, elinks is a terminal program not X. Your updateing the preferred X browser so it doesn't show up. Hopefully that helps you get pointed in the right direction.


I say never be complete, I say stop being perfect, I say lets evolve, let the chips fall where they may.

Offline

#8 2009-04-27 15:28:00

CJ Master
New Member
Registered: 2009-04-27
Posts: 9

Re: Clicking links in Terminator [SOLVED]

I would look for a extremally lightweight X program, I'm sure there's some around here. I can't seem to remember the name of one for my life though. roll

Offline

#9 2009-04-27 15:39:17

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Clicking links in Terminator [SOLVED]

Dillo is the most lightweight X based browser there is- next only to "links2 -g", I guess. Nevertheless, navigating through Dillo is a real chore- I find elinks to be far more keyboard friendly and advanced.

Reading the xdg-open (which as mentioned above, is what terminator uses to open URLs) man page did not provide any answers either.

Offline

#10 2009-04-27 17:37:15

fhsm
#! Junkie
From: New Hampshire, USA
Registered: 2009-01-05
Posts: 445

Re: Clicking links in Terminator [SOLVED]

#!/bin/sh
terminator --command="elinks $1"

Offline

#11 2009-04-27 19:36:06

fhsm
#! Junkie
From: New Hampshire, USA
Registered: 2009-01-05
Posts: 445

Re: Clicking links in Terminator [SOLVED]

$ touch ~/bin/runelinks
$ gedit ~/bin/runelinks

Last edited by fhsm (2009-04-28 13:09:00)

Offline

#12 2009-04-28 05:47:14

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Clicking links in Terminator [SOLVED]

Thanks, Fhsm! I have it working now.

I modified your suggested "runelinks" script (great name, by the way!) to the following:

#!/bin/sh
if pgrep "^elinks$"; then                                                     
    elinks -remote "openURL($*, new-tab)"
else
    terminator --command="elinks $*"
fi

so I wouldn't have to spawn a new instance of Terminator each time I click on a link.
I followed your instructions to the dot regarding the x-www-browser soft link.

ln -fs ~/bin/runelinks /etc/alternatives/x-www-browser

(I had to force ln to replace the existing link.)

Since my www-browser alternative was already set to elinks, I spent all of yesterday trying to change the behaviour of xdg-open and xdg-mime to open links with www-browser- that would have been an elegant solution. Too bad that can't be done.

This is pretty fantastic- Firefox, Flash and Javascript cause all kinds of trouble on my old laptop- I'm now one step further away from bloat.

I really appreciate that you wrote in such detail explaining the problem and the workarounds. You're not cramped for patience or time, I take it. smile

Offline

#13 2009-04-28 07:30:13

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,131
Website

Re: Clicking links in Terminator [SOLVED]

^^ nice work guys! smile

Offline

#14 2009-04-28 12:08:39

fhsm
#! Junkie
From: New Hampshire, USA
Registered: 2009-01-05
Posts: 445

Re: Clicking links in Terminator [SOLVED]

#!/bin/sh
if pgrep "^elinks$"; then                                                     
    elinks -remote "openURL($*, new-tab)"
else
    terminator --command="elinks $*"
fi

Offline

#15 2009-04-28 12:20:28

karthik
#! Member
Registered: 2009-01-29
Posts: 61

Re: Clicking links in Terminator [SOLVED]

Offline

#16 2009-04-28 13:08:08

fhsm
#! Junkie
From: New Hampshire, USA
Registered: 2009-01-05
Posts: 445

Re: Clicking links in Terminator [SOLVED]

Offline

#17 2014-02-19 20:08:10

srccon
Member
From: US of 'Merica
Registered: 2013-04-21
Posts: 36

Re: Clicking links in Terminator [SOLVED]

Dead Thread, I know.

Interesting little tidbit. I have Iceweasel, with all the privacy plugins, as my default browser verified with:

sudo update-alternatives --config x-www-browser

However, control-click in Terminator would always open links in chromium, used for webdev as my vanilla plugin-less browser, even though x-www-browser was set to iceweasel.

So I went into iceweasel preferences>Advanced>General and changed it to my default browser (I did not think that would matter due to x-www-browser), and that started terminator's URLs to open properly in Iceweasel. YAY!

So my question is, how does x-www-browser and the defaults set in within browsers work in CrunchBang?

Offline

#18 2014-03-18 23:36:03

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Clicking links in Terminator [SOLVED]

~/.local/share/applications$ cat mimeapps.list
[Added Associations]
application/rdf+xml=geany.desktop;
x-scheme-handler/mailto=exo-mail-reader.desktop
application/x-extension-eml=userapp-Icedove-WRPTBX.desktop;
text/html=exo-web-browser.desktop;userapp-Iceweasel-595QCX.desktop;
x-scheme-handler/file=exo-file-manager.desktop
x-scheme-handler/trash=exo-file-manager.desktop
application/octet-stream=geany.desktop;
x-scheme-handler/http=userapp-Iceweasel-595QCX.desktop;
x-scheme-handler/https=userapp-Iceweasel-595QCX.desktop;
x-scheme-handler/ftp=userapp-Iceweasel-595QCX.desktop;
x-scheme-handler/chrome=userapp-Iceweasel-595QCX.desktop;
application/x-extension-htm=userapp-Iceweasel-595QCX.desktop;
application/x-extension-html=userapp-Iceweasel-595QCX.desktop;
application/x-extension-shtml=userapp-Iceweasel-595QCX.desktop;
application/xhtml+xml=userapp-Iceweasel-595QCX.desktop;
application/x-extension-xhtml=userapp-Iceweasel-595QCX.desktop;
application/x-extension-xht=userapp-Iceweasel-595QCX.desktop;

[Default Applications]
x-scheme-handler/mailto=userapp-Icedove-WRPTBX.desktop
application/x-extension-eml=userapp-Icedove-WRPTBX.desktop
message/rfc822=exo-web-browser.desktop
text/html=userapp-Iceweasel-595QCX.desktop
x-scheme-handler/http=userapp-Iceweasel-595QCX.desktop
x-scheme-handler/https=userapp-Iceweasel-595QCX.desktop
x-scheme-handler/ftp=userapp-Iceweasel-595QCX.desktop
x-scheme-handler/chrome=userapp-Iceweasel-595QCX.desktop
application/x-extension-htm=userapp-Iceweasel-595QCX.desktop
application/x-extension-html=userapp-Iceweasel-595QCX.desktop
application/x-extension-shtml=userapp-Iceweasel-595QCX.desktop
application/xhtml+xml=userapp-Iceweasel-595QCX.desktop
application/x-extension-xhtml=userapp-Iceweasel-595QCX.desktop
application/x-extension-xht=userapp-Iceweasel-595QCX.desktop

Last edited by Alad (2014-04-01 18:56:39)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo