fim(1) | General Commands Manual | fim(1) |
fim - fbi (linux framebuffer imageviewer) improved
fim [{options}] [--] {imagefile} [{imagefiles}]
... | fim [{options}] [--] [{imagefiles}] -
fim [{options}] [--] [{files}] - < {file_name_list_text_file}
fim --image-from-stdin [{options}] < {imagefile}
fim --script-from-stdin [{options}] < {scriptfile}
fim is a `swiss army knife' for displaying image files. It is capable of displaying image files using different graphical devices while offering a uniform look and feel; it features an internal command language specialized to the image viewing purposes; it is capable of interacting with standard input and output; the internal command language is accessible via a command line capable of autocompletion and history; it features command recording, supports initialization files, customizable key bindings, internal variables and command aliases, vim-like autocommands, JPEG comments, EXIF tags display, EXIF rotation/orientation, and much more.
As a default, fim displays the specified file(s) on the detected graphical device (e.g. with SDL if X is detected, or the linux framebuffer device if not). JPEG,PNG,GIF,BMP,TIFF,PPM,PGM,PBM,PCX formats are supported. For 'XCF' (Gimp's) images, fim will try to use 'xcftopnm'. For '.FIG' vectorial images, fim will try to use 'fig2dev'. For '.DIA' vectorial images, fim will try to use 'dia'. For '.SVG' vectorial images, fim will try to use 'inkscape'. For other formats fim will try to use ImageMagick's 'convert' executable.
If {imagefile} is a directory, therein contained files of supported formats will be loaded. If {imagefile} contains a trailing slash (/), it will be treated as a directory; otherwise a check will be made using stat(2). To change this default, see description of the _pushdir_re variable and the --no-stat-push and --recursive options.
If configured at build time, fim will be capable of using SDL or aalib output.
This man page only describes the fim command line options. See man fimrc(5) for a full specification of the fim language, commands, variables, and an example configuration file.
You may invoke fim from an interactive shell and control it with the keyboard, as you would do with any image viewer with reasonable key bindings.
fim is keyboard oriented: there are no user menus or buttons available. If you need some feature or setting which is not accessible from the default keyboard configuration, you probably need a custom configuration or simply need to type a custom command. For these, you can use the internal command and configuration language. The full specification for these is accessible at runtime using the internal help system (typing :help).
Accepted command line {options} :
For example, -c '*2;2pan_up;display;while(1){align "bottom";sleep "1" ; align "top"}' (with the single quotes) will tell fim to first double the displayed image size, then pan two times up, then display the image ; and then do an endless loop consisting of bottom and top aligning, alternated.
For example, -C '_scale_style=" "' will make fim start with no auto-scaling.
Note that these the three standard input reading functionalities (-i,-p and -) conflict : if two or more of them occur in fim invocation, fim will exit with an error and warn about the ambiguity.
See the section INVOCATION EXAMPLES below to read some useful (and unique) ways of employing fim.
The program return status is 0 on correct operation; 252 on
unsupported device specification; 248 on bad input; 255 on a generic error;
42 on a signal-triggered program exit; or a different value in case of an
another error.
The return status may be controlled by the use of the quit command.
The following keys and commands are hardcoded in the minimal configuration. These are working by default before any config loading, and before the hardcoded config loading (see variable _fim_default_config_file_contents).
n goto '+1f'
p goto '-1f'
+ magnify
- reduce
h pan 'left'
l pan 'right'
k pan 'up'
j pan 'down'
q quit You can type a number before a command binding to iterate the assigned command: 3k 3pan 'up'
: enter command line mode :{number} jump to {number}^th image in the list :^ jump to first image in the list :$ jump to last image in the list :*{factor} scale the image by {factor} :{scale}% scale the image to the desired {scale} :+{scale}% scale the image up to the desired percentage {scale} (relatively to the original) :-{scale}% scale the image down to the desired percentage {scale} (relatively to the original) /{regexp} entering the pattern {regexp} (with /) makes fim jump to the next image whose filename matches {regexp} /*.png$ entering this pattern (with /) makes fim jump to the next image whose filename ends with 'png' /png a shortcut for /.*png.* !{syscmd} executes the {syscmd} quoted string as a "/bin/sh" shell command You can visualize all of the default bindings invoking fim --dump-default-fimrc | grep bind . You can visualize all of the default aliases invoking fim --dump-default-fimrc | grep alias .
The Return vs. Space key thing can be used to create a file list while reviewing the images and use the list for batch processing later on.
All of the key bindings are reconfigurable; see the default fimrc file for examples on this, or read the complete manual: the FIM.TXT file distributed with fim.
FBFONT (just like in fbi) a Linux consolefont font file. If using a gzipped font, the zcat program will be used to uncompress it (via execvp(3)). If not specified, the following files will be probed and the first existing will be selected: /usr/share/consolefonts/Uni3-TerminusBoldVGA14.psf.gz /usr/lib/kbd/consolefonts/lat9-16.psf.gz /usr/share/consolefonts/lat1-16.psf /usr/share/consolefonts/lat1-16.psf.gz /usr/share/consolefonts/lat1-16.psfu.gz /usr/share/kbd/consolefonts/lat1-16.psf /usr/share/kbd/consolefonts/lat1-16.psf.gz /usr/share/kbd/consolefonts/lat1-16.psfu.gz /usr/lib/kbd/consolefonts/lat1-16.psf /usr/lib/kbd/consolefonts/lat1-16.psf.gz /usr/lib/kbd/consolefonts/lat1-16.psfu.gz /lib/kbd/consolefonts/lat1-16.psf /lib/kbd/consolefonts/lat1-16.psf.gz /lib/kbd/consolefonts/lat1-16.psfu.gz /lib/kbd/consolefonts/Lat2-VGA14.psf.gz /lib/kbd/consolefonts/Lat2-VGA16.psf.gz /lib/kbd/consolefonts/Lat2-VGA8.psf.gz /lib/kbd/consolefonts/Uni2-VGA16.psf.gz /usr/share/consolefonts/default8x16.psf.gz /usr/share/consolefonts/default8x9.psf.gz /usr/share/consolefonts/Lat15-Fixed16.psf.gz /usr/share/consolefonts/default.psf.gz fim:// If the special fim:// string is specified, a hardcoded font will be used. FBGAMMA (just like in fbi) gamma correction (applies to dithered 8 bit mode only). Default is 1.0. FRAMEBUFFER (just like in fbi) user set framebuffer device file (applies only to the fb mode). If unset, fim will probe for /dev/fb0. TERM (only in fim) will influence the output device selection algorithm, especially if $TERM=="screen". DISPLAY If this variable is set, then the sdl driver will be probed by default.
fim needs read-write access to the framebuffer devices (/dev/fbN or /dev/fb/N), i.e you (our your admin) have to make sure fim can open the devices in rw mode. The IMHO most elegant way is to use pam_console (see /etc/security/console.perms) to chown the devices to the user logged in on the console. Another way is to create some group, chown the special files to that group and put the users which are allowed to use the framebuffer device into the group. You can also make the special files world writable, but be aware of the security implications this has. On a private box it might be fine to handle it this way through.
If using udev, you can edit :
/etc/udev/permissions.d/50-udev.permissions and set these lines like here :
# fb devices
fb:root:root:0600
fb[0-9]*:root:root:0600
fb/*:root:root:0600
fim also needs access to the linux console (i.e. /dev/ttyN) for sane console switch handling. That is obviously no problem for console logins, but any kind of a pseudo tty (xterm, ssh, screen, ...) will not work.
fim media/
# Will load files from the directory media.
fim -R media/ --sort
# Will open files found by recursive traversal of directory media, then
sorting the list.
find /mnt/media/ -name *.jpg | fim -
# Will make fim read the file list from standard input.
find /mnt/media/ -name *.jpg | shuf | fim -
# will make fim read the file list from standard input, randomly shuffled.
cat script.fim | fim -p images/*
# Will make fim read the script file script.fim from standard input
prior to displaying files in the directory images
scanimage ... | tee scan.ppm | fim -i
# Will make fim read the image scanned from a flatbed scanner as soon as it is
read
fim * > selection.txt
# Will output the file names marked interactively with the 'list
"mark"' command in fim to a file.
fim * | fim -
# will output the file names marked with 'm' in fim to a second instance of
fim, in which these could be marked again.
fim -c 'pread "vgrabbj -d /dev/video0 -o
png";reload'
# will display an image grabbed from a webcam.
fim -o aa -c 'pread "vgrabbj -d /dev/video0 -o
png";reload;system "fbgrab" "asciime.png"'
# if running in framebuffer mode, will save a png screenshot with an ASCII
rendering of an image grabbed from a webcam.
fim -c 'while(1){pread "vgrabbj -d /dev/video0 -o
png";reload;sleep 1;};'
# will display a sequence of images grabbed from a webcam; circa 1 per
second.
This manual page is neither accurate nor complete. In particular, issues related to driver selection shall be described more accurately. Also the accurate sequence of autocommands execution, variables application is critical to understanding fim, and should be documented. The filename "<STDIN>" is reserved for images read from standard input (view this as a limitation), and thus handling files with such name may incur in limitations. The SDL driver is quite inefficient, for a variety of reasons. In particular, its interaction with the readline library can be problematic (e.g.: when running in sdl mode without a terminal). This shall be fixed.
fim has bugs. Please read the BUGS file shipped in the documentation directory to discover the known ones.
Other Fim man pages: fimgs(1), fimrc(1).
Or related programs: fbset(1), con2fb(1), convert(1),
vim(1), fb.modes(8), fbset(8), fbgrab(1),
fbdev(4), setfont(8), xfs(1).
Michele Martone <dezperado _CUT_ autistici _CUT_ org> is the author of fim, "fbi improved".
Copyright (C) 2007-2016 Michele Martone <dezperado _CUT_ autistici _CUT_ org> (author of fim)
Copyright (C) 1999-2004 Gerd Hoffmann <kraxel _CUT_ bytesex.org> is the author of "fbi", upon which fim was originally based.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
(c) 2007-2016 Michele Martone |