Enhancement: launch a viewing program when filenames
are clicked in a directory listing that appears on
screen. The setup for this is that your shell has to
print out a new escape sequence every time you change
directories, and rxvt keeps track of what directory
goes with what line on the screen (or in the scrollback
buffer). An external script is launched with the path
and file as arguments, and the script can then
determine the file type and exec an appropriate viewing
program. A side effect of this enhancement is that it
also allows a shift+left click to extend selections.
Not a default option, either. There are a few other
things that must be set up correctly for this to work,
Command line switch/resource:
*launchProg: (filename) (or [-launcher filename] from
the command line)
The name of the executable (e.g. a script) to use
as a middleman to decide what viewer to launch for the
path and file sent to it as arguments.
Launch the filename if clicked once with the right
Launch the filename if double-clicked (with the
left mouse button). Using this one (versus the right
click) causes a slight delay because rxvt has to decide
that you didn't mean to continue to select stuff with
the left mouse button. Only after the double click
happened fast enough *and* you've released the mouse
button soon enough after the final click will it go
with the launch.
Note that both launchRightClick and launchDoubleClick
can be enabled at the same time. Dunno why you'd do
that, but let's call it a feature.
You need to have an executable somewhere (typically a
shell script) that will decide which viewer/editor
program to launch given a path and filename sent to it
by rxvt. Here's a sample script that I use. I call it
rxvtrun.sh, put it in my path somewhere, and set my
this in my ~/.Xdefaults:
I'll include this disclaimer on all of these patches
just to make sure that the source code remains GPL'd.
It is Copyright (c) 2003 Rob McMullen
<email@example.com>, licensed under the GNU General
Public License (version 2 or later).