How I use Firefox's remote control

April 13, 2008

I'm quite familiar with Firefox's weird remote control because I've been exploiting it for years in my peculiar environment (enough years that when I started doing it, I was using Netscape Navigator instead). As you might guess, the overall goal of my environment is to keep the browser running all the time, because back in the days when I started doing this the browser started even more slowly than it does now.

To stay running, Firefox needs to have a window open, so I keep an iconified Firefox window parked off in the corner of my virtual screens. I talk to it with a number of tools, primarily:

  • a shell script that reads the current X selection and passes it to Firefox if it's a URL. If there's nothing in the selection, it just opens a new window on my start page.
  • a related program that reads the X selection and fires it off to Firefox as a Google search.

  • a TK program that opens up a text box for entering URLs; it also accepts keywords at the start to do Google searches and call up Python module documentation.

I wrote the last program because I got tired of opening up a terminal window just to type the equivalent of 'firefox <URL>' and figured I'd rather do it directly. All of these programs are wired up to menu entries on two of my core window manager menus, to the point where one chorded mouse click on the root opens up a new Firefox window.

I have Firefox (and these programs) set to open everything in new windows instead of using tabs. You could probably do this with tabs, but since which window Firefox will add the new tab to is a bit unpredictable I think you'd want to have only one Firefox window. I'm a 'one window, one purpose' person, so I actively like having lots of separate Firefox windows.

While current Gnome and KDE terminal programs can do this without my Rube Goldberg system, that's only in terminal windows. I've found it really useful to have an environment where any selected URL can be sent to my browser, regardless of what program I'm selecting it in.

(And the ability to make Google queries from any selection is quite handy.)


Comments on this page:

From 130.217.250.13 at 2008-04-14 02:56:18:

Have you heard of plan9's plumber? Basically it has a variety of rules that can check (is this a file? does it match this regex?) and based on those rules will send the contents of the selection to a program. Thus if it matches (.):([0-9]+) and $1 is a file, then open up an editor on $1 and put the cursor on line $2. If it matches http://(.) then pass it to a webbrowser. If it matches (.*\.(gif|tiff|png|jpg|jpeg)) then load an image viewer on it etc. See http://plan9.bell-labs.com/sys/doc/plumb.html for more information.

Perry Lorier

By cks at 2008-04-17 13:02:52:

I've seen plumber before (and there's even a version for Unix as part of Plan 9 from User Space, although I haven't tried it). I'm not sure how well it would work in a generic Unix environment, as a fair amount of the power seems to come from knowing the current directory that the text comes from (so you can, eg, go from a compiler error message to opening the right file).

I have some additional select-and-... actions set up in my window manager, but I've wound up never using them. (Possibly I picked the wrong actions; right now I have 'log into machine name' and 'read manual page'.)

Written on 13 April 2008.
« Different reasons for having comments
A sysadmin's review of the ASUS Eee PC »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sun Apr 13 23:46:59 2008
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.