gitaction - GNU Interactive Tools - per file type action script
gitaction directory file
.gitaction directory file
is a script that executes a different action for each file type
specified. It is called by the gitfm
program when pressing F2
(see the gnuitrc.TERM
configuration files in the
manual). The first parameter is the current directory name and
the second one is the file name to be matched against the default patterns.
The matching is done using the shell 'case' statement. If you press F2
on a *.html
will invoke a browser to
view it, if you press F2
on a *.tar.gz
will list the tar archive contents, if you press the same keys on
will display its uncompressed contents on the
screen, etc ...
If you press F2
on a *.gif
file or *.jpg
and you have the zgv
utility installed, you will be able to see it. If
you want to change the gif/jpeg viewer, all you need to do is to change its
name in the gitaction
There are many more file types and viewers that gitaction
knows about. In
addition, if you are running under GNOME, gnome-open is used, and on MacOS,
open(1) is used. see(1) and metamail(1) are also used as fallbacks.
If all else fails, the file is displayed using $GNUIT_PAGER. Feel free to change
this. If you want to find out what the default action for each file type is
(or if you want to modify it), just read/modify the gitaction
The script can be easily enhanced. Just read it.
script is a local version of the gitaction
When started, gitaction
tries to search a script called
in the current directory and, if it finds it, it starts it.
's exit code is 0 ( .gitaction
couldn't find a
matching pattern), gitaction
starts its own case statement trying to
match the current file name (the second parameter) against its default
script *must* be executable. An example of
can be found in the directory gitfm is installed into.
) Debian users can find it in
. You should copy the example to the
current directory or your home directory and then modify it.
Please send bug reports to:
gitfm(1) gitps(1) gitview(1) gitmount(1) gitkeys(1) gitrgrep(1) gitunpack(1)
Tudor Hulubei <firstname.lastname@example.org>
Andrei Pitis <email@example.com>
Ian Beckwith <firstname.lastname@example.org> (current maintainer).