
Small tips and tricks for more effective use of FileRunner


1. How to view .html files in Firefox from FileRunner.

It is convenient to view .html files by right-clicking on them. 

This just works by putting the following in your
config(view,extensions) variable:

  { {firefox %s}
    {*.html} }

If you (like me) like to run filerunner as root and want to look at files with
firefox (or other programs that don't want to be called by root) you can put
a helper file (I call it myfirefox) that looks like this:

#!/bin/bash
#
# if we are root, pass the request to the local account
#
if [ `whoami` = "root" ] ; then 
#    echo "trying su --session-command=myfirefox $@ YOURNAME"
    su --session-command="firefox $@" YOURNAME
else
#    echo "trying firefox $@"
    firefox "$@"
fi
------------------------------------------------------------
Put this in your /home/YOURNAMR/bin directory and then change the 
config(view,extensions) variable to call 'myfirefox' (or what ever you name it).

2. How to handle file names with blanks in the view (and other) config text.

The configuration file can contain file & path names that are needed to 
reference helper tasks (editor, view tasks, etc).  If these paths contain blanks
you must tell filerunner about them by using braces (for example for firefox):

{{ {/home/john jones/bin/myfirefox} %s}
   {*.html} }

See also the note on 'config(space)' in the configure file.

3. Right justifying file size in the list boxes.

The directory list box format is controlled by 'script' in the configure file.  
Open the configuration browser (Configuration -> Edit Configuration) and, under
appearance select 'ListBoxScripts'. Each fields format is set here.  There is no
true right justify in tcl but you can get close by using format %Ns where N is the
number if digits you expect in your number.  If the number contains more than N 
digits the format command will extend the field to the right so the result is
right justified until you encounter a number too large for the field.  At the 
moment I am using:

    {links {format %3s $nlink}}
    {size  {format %6s $size}}

for the links field and the file size field.

4. Puting a space before the file name in the directory list boxes.

First read the above "Right justifying file size in the list boxes."
Using the same trick, use (note the space in front of the %):

    {file  {format " %s" $ffile}}

for the file entry.

5. Man files and filerunner.

I use the following view extension for man files:
  { {man   {%s} | ul -t dumb}
 {*.1m.gz *.1.gz *.2.gz *.3.gz *.3pm.gz *.3ssl.gz *.3t.gz *.3thr.gz *.3x.gz *.4.gz *.5.gz *.6.gz *.6x.gz *.7.gz *.8.gz *.9.gz *.n.gz *.1 *.1m *.2 *.3 *.3t *.3thr *.3x *.4 *.5 *.6 *.6x *.7 *.8 *.9 *.n *.1x *.2x *.3x *.4x *.5x *.6x *.7x *.8x *.9x *.1x.gz *.2x.gz *.3x.gz *.4x.gz *.5x.gz *.6x.gz *.7x.gz *.8x.gz *.9x.gz}
   -viewtext }

Problem is that man seems to want to come up with different line lengths and thus poor formatting.  To fix this I put this:

global env
set env(MANWIDTH) 80

in the file 'config' in the filerunner directory.  This sets the environment variable MANWIDTH which man uses to set its line length.  This file is 'source'ed each time filerunner starts so any program run by file runner will see any environment variables set here.  This does not seem to work on Windows systems, however.

If you have a good tip to share with other FileRunner users, please send it to the author.
