sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

FIM (Fbi IMproved) image viewer program homepage

A screenshot of a regular (framebuffer) FIM run (SDL would look the same) A screenshot of a monochrome ASCII Art FIM run A screenshot of a coloured ASCII Art FIM run
FIM is a lightweight universal image viewer, conceived when working in Linux.  
FIM aims to be a highly customizable and scriptable image viewer for users who are comfortable with software like the VIM text editor (see this minitutorial) or the Mutt mail user agent (see this minitutorial).  
It has been developed with Linux in mind, but can be built to run on several Unix systems or even on MS-Windows.
 
It is lightweight: it depends on a few libraries (and most optional), it can display in full screen and you control it using the keyboard.
It is universal: it can open many file formats and it can display pictures in the following video modes:
The right video mode gets auto-detected or selected at runtime, and may be opted in/out before build at configure time, if desired.
 
FIM is free software (see licensing info) and it is richly documented (see the documentation section).
 
Official FIM homepage: https://www.nongnu.org/fbi-improved/ (this ugly one here, yes).
 
Savannah Project web page: http://savannah.nongnu.org/projects/fbi-improved/.
 
Official mirror (on the Savannah mirror network): http://download.savannah.nongnu.org/releases/fbi-improved.
 
Official FIM mailing list: http://savannah.nongnu.org/mail/?group=fbi-improved.
 
FIM has been realized by Michele Martone, with inspiration from other software (especially VIM) and science fiction movies.  
FIM started as a fork of the Fbi image viewer by Gerd Hoffmann.
 
If you like FIM, consider: sending a "thank you" message to its author; supporting the Savannah project, whom network kindly hosts FIM repositories; donating to the Free Software Foundation Europe; donating to the Free Software Foundation; donating to Autistici/Inventati.
 

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

Tutorials

We have the following tutorials:

Tutorial: Browsing through a photo collection with FIM

The very basics of FIM are opening files, e.g.: fim DSC_0001.JPG DSC_0002.JPG or a directory of files, e.g.: fim -R ~/Pictures/
... and browsing through them with the basic keys:
n (next file), p (previous file), + (magnify), - (reduce), r (rotate), m (mirror), f (flip), ...
(see documentation for the common defaults for keys and commands).

Starting with version 0.5, FIM has powerful features to browse through photo collections.
Say you have a collection of digital photographs, e.g. thousands of JPEG files:
$ ls
DSC_0001.JPG	
DSC_0002.JPG	
...
sample.jpg

You can maintain textual descriptions of them and have them displayed in FIM.
To do so, first produce a text description file, say with: ls | sed 's/$/\t/g' > files.dsc, containing:
# This is a FIM images description file.
# A line beginning with a pound (#) is treated as a comment.
# Each line consists of the file name, a Tab character and a textual description of the given picture:
DSC_0001.JPG	A big dog.
DSC_0002.JPG	A statue.
# ...
sample.jpg	Busto di Diana. Da Pompei, 1817, rinvenuto presso i portici occidentali del santuario di Apollo. Bronzo, II s.a.C. MANN, inv. 4895.
# The file can be long as you wish.

Then invoking e.g. fim --load-image-descriptions-file files.dsc sample.jpg ... will additionally display each image description on screen, just like in the following screenshot:
On the top of the screen you can see the Busto di Diana. Da Pompei, 1817... image description from the files.dsc file.
But one can display more information about the image.
In the status line (lower side) of the screenshot there is additional information, which can be customized via the _display_status_fmt and _info_fmt_str variables of your ~/.fimrc file.
The _info_fmt_str variable controls the information in the lower right corner, e.g.:
# This is a sample custom ~/.fimrc file.
# A line beginning with a pound (#) is treated as a comment.
# The other lines are treated as fim commands and need to end with a ; (semicolon).

# _info_fmt_str is set to display current scale percentage, width, height, ... 
_info_fmt_str="%p%% %wx%h%L %i/%l%P img:%M cache:%C tot:%T %c"; 

# See man fimrc for a reference on the fim language commands.


In the left side of the status line of the screenshot there is additional information: [1/15 sec.][f/4.0][ISO400].
These are respectively exposure time, aperture and ISO Speed rating.
FIM extracts this information from the EXIF section of the JPEG file at load time.
EXIF information usually pertains the camera, the shot and the digitized image, and can be camera and vendor specific.
Each piece of such information is called EXIF tag and has a name.
FIM does not know about all possible EXIF tag names, but it loads into variables associated to each loaded image each EXIF tag it encounters.
In the above case, the status line displays the values of three variables corresponding to EXIF tags: i:EXIF_ExposureTime, i:EXIF_FNumber, i:EXIF_ISOSpeedRatings.
If you don't know in advance the names of the EXIF tags your camera produces, then load a photograph file, enter in console mode by typing :. and print the list of variables loaded with the image: echo i:*.

In the example above, the _display_status_fmt has been customized as e.g.:
# This is a sample custom ~/.fimrc file.
# A command can span multiple lines, and long strings can be composed by substrings joined by a dot (.).
  
# The following info format string pertains the lower
#  left part of the status line.
# Assuming these are set, it uses each of the values 
#  in EXIF_ExposureTime, EXIF_FNumber, EXIF_ISOSpeedRatings.
_display_status_fmt=
	"%?EXIF_ExposureTime?[%:EXIF_ExposureTime:]?".
	"%?EXIF_FNumber?[%:EXIF_FNumber:]?".
	"%?EXIF_ISOSpeedRatings?[ISO%:EXIF_ISOSpeedRatings:]?:%k";
# Above, the dot (.)  has been used to break the declaration of a long string.

# See man fimrc for a reference on the fim language commands.

The mechanism of displaying per-image variables can be used also in the following way.
Assuming an image has the i:city variable set to a certain value, this might be displayed in the status line by having e.g;:
_display_status_fmt="%?city?[%:city:]?";
One can use this in conjunction with the following description file syntax:
# This is files.dsc
# Lines starting with '!fim:varname=varvalue' are not comments: they set variable varname to varvalue for the images following.
#!fim:city=Rome
DSC_0001.JPG	A big dog.
#!fim:city=Naples
DSC_0002.JPG	A statue.
# ...
sample.jpg	Busto di Diana. Da Pompei, 1817, rinvenuto presso i portici occidentali del santuario di Apollo. Bronzo, II s.a.C. MANN, inv. 4895.
#!fim:city=
unknown.jpg	Unknown city.

This syntax will ensure that e.g. DSC_0001.JPG will have i:city="Rome" while DSC_0002.JPG, sample.jpg will have i:city="Naples" and unknown.jpg will have the value i:city="" (unset).

This mechanism can be brought further with the new limit command. Given a long list of files, entering the limit "city" "Naples" command will temporarily restrict the browsable files list to the files having i:city=="Naples".
This is useful when restricting the research in an archive down to a few pictures.
Entering limit again will reset the list.

Even more can be achieved using the file marking mechanism. This mechanism allows to build up a list of file names to be printed out on the standard output when FIM terminates.
Assume you want to browse your big pictures collection to select the ones you want to send to a friend.
You can browse the pictures list and mark one by typing key Enter each time you think it is worth sending.
Once you have marked many of them you wish to re-check them. By entering limit "!" only the marked files will be displayed. Then you can eventually unmark (u) some pictures, and when exiting, fim will print out to standard output only the ones effectively marked.

The examples above are just a small fraction of what you can do with FIM; see the documentation for more.

Tutorial: How to display attached images in Mutt using FIM

I assume you know how to use Mutt.
One can instruct Mutt to open attachments or multimedia files using specific programs.
This is obviously possible also with FIM and images.

All you have to do is to edit the ~/.mailcap file, which is used by Mutt when you open an attachment.
The following suffices for a minimal integration:
image/*; fim %s

You can also instruct FIM to use ASCII art if we are working over an SSH connection:
image/*;( [ "$SSH_CLIENT" != "" ] && fim -o aa  %s ) || ( fim %s )
If you have configured FIM properly, this will work seamlessly in the Linux framebuffer, in X and through SSH.

Finally, if you wish to use the fimgs wrapper script (installed automatically when you install fim) to convert transparently with different programs, and then display with FIM, you can do it like here:
image/*;( [ "$SSH_CLIENT" != "" ] && fim -o aa  %s ) || ( fim %s )

# Use evince, and if not, fimgs:
application/pdf;( [ "$DISPLAY" != "" ] && evince %s ) || fimgs %s

# Use gv, and if not, fimgs:
application/ps;( [ "$DISPLAY" != "" ] && gv %s ) || fimgs %s
application/postscript;( [ "$DISPLAY" != "" ] && gv %s ) || fimgs %s

# Use xdvi, and if not, fimgs:
application/x-dvi;( [ "$DISPLAY" != "" ] && xdvi %s ) || fimgs %s

# The following two examples are more funny than useful.

# Display each bit as a pixel:
application/octet-stream; fim --binary=1 %s

# Display a text file rendered:
application/vnd.openxmlformats-officedocument.wordprocessingml.document; docx2txt < %s | fim --as-text -i -q

Tutorial: VI/VIM-like feel in FIM

If you know the VI/VIM text editor shortcut based usage interface, then you know how to appreciate the comfort and speed of use it gives.
FIM offers a few features aimed at VI/VIM users, like:
  • The motion keys: j (like 'down' arrow), k (like 'up' arrow), h (like 'left' arrow), l (like 'right' arrow),
  • Repeat any interactive command by prepending it by a number.
    E.g.: magnify two times in a row by pressing 2+
  • Filename based search.
    E.g.: jump to a file containing 'dog' in its name by pressing: / and entering dog then Enter.
  • Search backwards using ? instead of /.
  • Repeat the last action by pressing ..
  • Jump to the first file by pressing ^ or to the last file by pressing $.
  • Enter in command line mode by pressing : and Enter to go back in interactive mode.
  • When in command line mode
    • type any command, like e.g. help and execute it after pressing Enter.
    • type a number and then Enter to jump to the image with that index in the list.
    • use the up and down arrows to navigate the history (via the GNU history library).
    • if using the framebuffer, GNU Emacs-like (via GNU readline, just as in BASH) command line editing is possible.
  • Execute a command after startup: fim -c command.
  • Read an image via standard input, e.g.: cat image.jpg | fim -i (note the difference: in VIM it's-, not -i).
    This is meant to be used with converters, e.g.: convert image.pic ppm:- | fim -i.
  • Set autocommands with the autocmd command.

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

News: What's new with FIM

(last update: 24/09/2023)
FIM NEWS -- history of main user-visible changes in FIM.

                Version 0.6-rc2

 * File dropping support in SDL2 mode and more responsive readline mode.

                Version 0.6-rc1

 * Experimental support for SDL2.

                Version 0.6-rc0

A summary of major improvements:

 * Colour ASCII-Art output via libcaca, selected with -o ca
 * better mechanism to determine best output device
 * font magnification by integer factors, good for higher resolutions
 * runtime font selection
 * new options to commands "scale", "goto", "limit", "list", ...
 * 'limit' view to relevant image files based on properties (like in 'mutt')
 * pass key presses to be automated at startup with -k and -K options
 * pretty free from memory leaks
 * -X switch inhibits custom external converters
 * new powerful subcommand "list 'mark'"
 * new command-line switches (--sort..) to sort the initial files list
 * use mipmaps for faster scaling
 * open files from a files list with -L
 * load image description files with -D 
 * background recursive scan and load of files with -B
 * search files at startup based on description with -/ and --//
 * new verbosity and debug options
 * better error handling when encountering corrupt files
 * fast in-place switch to high-res file via --load-shadow-directory 
 * improvements in -o aa (Ascii Art output device with aalib)
 * more options for window size selection in -o sdl
 * Keys F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12 now usable with 'bind'

In detail, in no particular order:

 * Experimental support for SDL2.
 * More responsive readline mode.
 * Switch --resolution 'fullscreen' appends 'W' if in SDL mode.
 * If a "matrix market" file is loaded, its rows, columns and nnz are image variables, too.
 * Introduce special 'early' form  -C =var=val  where variable var is assigned to unquoted and non-interpreted value val immediately.
 * Fix: --cd-and-readdir was not jumping back to first file.
 * Fix: --device option not ignored anymore.
 * Rename --no-etc-rc-file switch to --no-etc-fimrc-file .
 * fimgs: bunzip2, wget, and xz are now optional.
 * Bugfix: fimgs to properly remove temporary directory after loading downloaded files.
 * Misc small improvements in documentation text output and reporting (no cursor in post-search output line; misc messages).
 * Key 'Z' now assigned to 'sleep 1'.
 * Key 'Del' now assigned to 'list "remove"'.
 * Add -= as short form of the --no-auto-scale option.
 * Experimental: add command "crop", also activated after selecting the area by holding Shift and clicking with left mouse button (if running with -o sdl).
 * Add command "pan 'vsteps%' 'hsteps%'" and "'pan 'vsteps' 'hsteps'".
 * Keys F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12 are now usable with 'bind' with modes -o aa, -o ca, -o dumb.
 * Fix for -o sdl: when flipped or mirrored, it used to draw a smaller box by mistake.
 * Only filenames matching "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$" can occur in a conversion command involving an external program.
 * --pread-cmd=command  substitutes any occurrence of '{}' in command with the actual filename, executes the result and reads an image from its stdout.
 * -o fb=S will not tolerate running under screen.
 * Bugfix in --script-from-stdin now prevents possible crashes.
 * Removed configure options --enable-c++11 -- use CXXFLAGS instead.
 * Bugfix: 'autocmd_del' with no arguments would crash.
 * Bugfix: autocommand "PostHardcodedConfigLoading" now triggers even if --disable-fimrc .
 * Internals: considerably expanded 'make tests'.
 * Add command 'stderr', similar to 'stdout'.
 * This is the last FIM version supporting the C++03 standard.
 * Refresh configure and Makefile templates.
 * Build fixes for the MinGW environment.
 * man fim: improve manual contents (on ~/.fim_history, individual options, wording, etc.).
 * man fimrc: added a section with default aliases,
 * Where appropriate, 'make tests' uses 'timeout' to prevent possible hangs.
 * Switch  -K <chars>  aka  --chars-press <chars> simulates input of characters at startup.
 * Fix: slideshow function (e.g. `fim --slideshow=5 media/`) will now cycle forever, unless --once/-1 option specified (as in fbi).
 * Fix: after 'quit' no command shall execute anymore (unless in -F).
 * With SDL one can specify window size as percentage of allowed size (-o sdl=w55%), or draw a help grid map (-o sdl=h).
 * With SDL (-o sdl), center window by default.
 * Fix: now pressing keys "1n1n" will not execute 'n' 11 times, but twice.
 * configure --enable-debug is a developer option now.
 * libcaca (-o ca) mode is now complete and is the default ASCII Art mode.
 * Slideshow function (e.g `fim --slideshow=5 *.jpg`) now more responsive.
 * Arrow keys are now working in aalib (-o aa).
 * Bugfix with aalib (-o aa): don't truncate long lines.
 * Avoid memory leak in language parser.
 * Avoid console buffer memory corruption.
 * Eliminate a memory leak from file loading code. 
 * Eliminate memory leaks in PNG, JPG, TIFF, EXIF, and font decoding code.
 * Fix possibly broken `make -j` in rebuilding fimgs.man and fimrc.man.
 * Correct configure script check for regcomp() -- could lead to false negatives.
 * Don't break build on missing 'gs'.
 * Experimental: use --load-shadow-directory <dir> to add a "shadow directory".
   Then 'scale "shadow"' (bound to key '"') will substitute the current displayed image
   with that of the first same-named file located under a shadow directory.
 * When loading a directory, regular expression from default "_pushdir_re" variable now matches filenames with .webp extension.
 * Fix: `fim -c '/<pattern>'` was broken.
 * Add " INTEGER , INTEGER IDENTIFIER arguments" syntax to repeat a command 
   on each file in the interval and substitute its name to '{}' in the arguments
   to an iterated command IDENTIFIER.
 * If a key is bound to e.g. 'goto "+1F"', keep pressing it to accelerate (not if e.g. "+1f").
 * Internal fix: piping from external commands was using 0 instead of 'WNOHANG', leading to hanging.
 * Internal fix: error handling was missing.
 * fimgs now to handle tar.xz archives.
 * Reload automatically image on file change.
 * Command 'list' 'sort_var' 'var' to sort file list according to values of 'i:var'.
 * Command 'list' 'sort_comment' to sort file list according to 'i:_comment' value.
 * Add a --verbose-font-load switch to set '_fbfont_verbosity=1'.
 * Variable '_fbfont_verbosity' sets verbose font loading.
 * Fix: short options -b, -h, -R were not getting optional argument (e.g. -b1).
 * Key combination C-r now assigned to "reload ''".
 * Fix: symbol from fbi sources clashed with gcc-6 onwards, breaking compilation.
 * Key combination C-w assigned to setting auto-scaling to width.
 * Smoother scroll of large images.
 * If SSH_TTY set and no output device specified, give precedence to aalib, then libcaca.
 * Bugfix: in --as-text will avoid repeated reload of file.
 * Hardcoded font (if configured in) will serve as fallback font.
 * Add a --no-pipe-load / -X switch to _no_external_loader_programs=1;
 * Description variables beginning with '_' will not go into i: .
 * List variables in all i:* read from description file with "list 'vars|variables'".
 * Expansion of @variables and @# comments from description files.
 * The menu key in SDL mode shows a temporary mouse click actions menu.
 * Bugfix: description file reading was crashing due to wrong check.
 * Caption text of "_caption_over_image" takes at most half of the screen.
 * If _caption_over_image=3, image is possibly drawn below the caption.
 * The 'v' and 'S' keys now cause a redraw.
 * The description line can be of any length.
 * New configure option, defaulting to: --enable-paths-in-man; it generates man pages with configure specified paths (e.g. sysconfdir, docdir).
 * Fix: -s switch was broken.
 * Add a semicolon (;) to -C arguments if not present already.
 * Framebuffer console switch off while loading: configure with the 
   --enable-framebuffer-switch-while-loading switch to have it back.
 * Fix: configure would fail on --disable-aa and absent aalib.
 * Now configure has --enable-seek-magic by default. And is more verbose.
 * Command 'help' also shows key bindings, and give multiple answers if matching.
 * For each word following switch --help, an individual help message is shown.
 * Command 'goto' accepts multiple arguments; evaluating them until the first one triggering a jump.
 * Command goto {'-/'|'+/'}[C] jumps to a file based on character C (default 'S').
   If C is 's', to prev/next file with same directory name.
   If C is 'd', to prev/next file with directory name down the same hierarchy.
   If C is 'u', to prev/next file with directory name up the same hierarchy.
   If C is 'b', to prev/next file with same basename.
   If C is as above but uppercase, to the prev/next file not matching the criteria.
 * Accordingly, aliases 'next_file_dir_same', 'next_file_dir_other', 'next_file_dir_up',
   'next_file_dir_down', 'next_file_same_basename', 'prev_file_dir_same',
   'prev_file_dir_other', 'prev_file_dir_up' 'prev_file_dir_down' 'prev_file_same_basename'.
 * Fix: 'recording' command was not functioning properly.
 * Fix: don't pop back last command if "recording 'stop'" executed outside of recording mode.
 * Fix: won't clear recorded list if calling recording 'start' multiple times.
 * Specifying more than once any of -p -i - causes a warning.
 * New switch --verbose-interpreter to execute interpreter verbosely by setting adequately _debug_commands='ackC'.
 * Strings specified within single quotes have single quotes escaped, just as double quotes.
   So that e.g.: '\'hello\'' equals "'hello'" and "\"hello\"" equals '"hello"'.
 * Variable '_debug_commands' is now a string with several verbosity options.
 * Fix: misc fixes for --offset, e.g. avoiding probing for external loader programs.
 * Add --verbose-load option for verbose file loading.
 * -C '_seek_magic=..' probes whole range of specified signature when loading a file.
 * Fix in _seek_magic documentation.
 * Option --offset accepts numbers suffixed by one of K, M, and G for respectively kibi-, mebi-, and gibi- (2^10, 2^20 and 2^30) units.
 * Bugfix: --offset option was ignoring lower bytes-offset.
 * Fix: a check was missing in the PS decoder when reading from stdin.
 * Command 'pan' accepts '-' and '+' to jump to prev/next file if border is reached.
 * Command 'font' controls displayed font and scans font directories.
 * Keys '{' and '}' cycle through available consolefonts.
 * Variable _fbfont_magnify_factor scales text font at runtime.
 * Variable _fbfont_as_screen_fraction; if >0, font is scaled to exceed 1/_fbfont_as_screen_fraction of both width and height.  If _fbfont_as_screen_fraction<0, font scaling is fixed.
 * Keys '[' and ']' bound to new aliases "font_reduce" and "font_magnify".
 * Key '|' bound to new alias "toggle_font_auto_scale".
 * Switch -r {width:height} / --resolution {width:height} behaves as expected in SDL mode.
 * Variable _downscale_huge_at_load, if 1 (default), downscale automatically huge images at load time. To avoid loading images exceeding too much screen size.
 * Variable i:_buffered_in_tmpfile stores temporary decoding image filename, if any.
 * Internally load SVG files by invoking inkscape <file.svg> --without-gui --export-png <temp.png>. A file beginning with "<svg" is be considered an SVG (Scalable Vector Graphics).
 * Command 'scrollforward' skips a border if this is less than a fraction of the screen; this smoothes up documents reading. The fraction is one over '_scroll_skip_page_fraction', if >1; 1/16 if 1, no tolerance if <1.
 * Variable "_want_wm_mouse_ctrl" controls mouse click/movement behaviour in SDL mode.
 * Variable "_min_cached_images" is the minimum number of images to keep from eviction.
 * Commands  scale '<'  /  scale '>' shrinks/magnifies the image using cached mipmaps.
 * By default, show mouse cursor in full screen SDL mode.
 * Autocommand "PostInteractiveCommand" does not trigger anymore after 'quit' command.
 * In case of a CBZ,CBR,PDF,PS,DVI file, the fimgs script now uses '--autotop --autowidth'.
 * The fimgs script now probes for unrar-nonfree/rar/unrar-free (in this order).
 * Customize overlay text via variable '_caption_over_image_fmt'.
 * Command syntax 'goto {+|-}identifier[+]' (new) jumps to next file having a different value of i:identifier, also empty if without trailing `+'.
 * Command "limit '-set_union'" merges current limited list with the new one.
 * Command "limit '-merge'" merges current limited list with the new one.
 * Command "desc 'reload'" loads once again description files specified at the command line with --load-image-descriptions-file.
 * FIM only checks for filename duplicates if a sorting option is specified.
 * Switch -P/--text-reading fixed. Seems to be broken in version 0.5.
 * Command "color": "color 'negate'" and "color 'desaturate'" introduced.
 * Commands 'negate' and 'desaturate' deleted.
 * Command "color CVS" (CVS among 'protanopia', 'deuteranopia', 'tritanopia', 'p', 'd', 't') simulates a color vision deficiency; adding 'daltonize' applies a tentative color correction;  "color 'colorblind'" is short for "color 'deuteranopia'".
 * Command "color 'identity'": populate the image with 'RGB identity' pixels.
 * Introduce a "#!fim:/=dir" special description line to specify directory prepended to basename.
 * Introduce a "#!fim:\=dir" special description line to specify directory prepended to filepath.
 * Command limit '-list'      lists existing variables identifiers as set via 'desc'
 * Command limit '-list' 'id' lists existing values for instances of variable 'id' as set via 'desc'
 * Command "limit '~i' MINIDX[-MAXIDX]", with MINIDX and MAXIDX numbers (possibly with K as x 1000 multiplier) restricts filenames list to the specified interval.
 * Command "limit '~d'", limits to files having exact current file's modify date +- one day.
 * Command "limit '~z'" limits to files having same file size as the current.
 * Command "limit '~z' MINSIZE[-MAXSIZE]", with MINSIZE and MAXSIZE numbers with possibly K (x 1024) or M (x 1024 1024) multipliers, limits according to file size.
 * Command "limit '~d' MINTIME[-MAXTIME]", with MINTIME and MAXTIME numbers, limits files list according to file modify date (expressed as seconds since the epoch, see 'man 2 time').
 * Command "limit '~d' MINDATE[-MINDATE]", with MINDATE and MAXDATE dates as in DD/MM/YYYY, and after 1900.
 * Command "limit '-further' ..." makes 'limit' act on the current list, rather than on the full anew. 
 * Command "limit" uses new criteria:
   If invoked with '~!' it restricts to files with unique basename.
   If with '~=', to files with duplicate basename;
   if with '~^', to the first of the files with duplicate basename;
   if with '~$', to the last of the files with duplicate basename. 
 * Alias "unlimit" resets the limited list.
 * Add variable '_all_file_loaders': a space-separated list of hardcoded file loaders usable with '_file_loader'.
 * Switch -R/--recursive[=arg] has now an optional argument; overwrites (if set) or appends to (if beginning with + or |) the "_pushdir_re" variable (recursed filename extensions).
 * Introduce a "#!fim:+=" special description line to append to cached description.
 * Introduce a "#!fim:^=" special description line to prepend to cached description.
 * Introduce a "#!fim:!=" special description line to reset all variables of the cached namespace.
 * Command 'desc        "save"' functionality to save descriptions file data from the currently browsable images list.
 * Command 'desc "-append" "save"' works in append mode.
 * Command 'desc "-all" "save"' saves also all descriptions file variables.
 * Command 'desc "-nooverw" "save"' does not force overwrite.
 * To ease reproducible builds: imposing LC_ALL=C to $(YACC) and $(SORT), vim2html.pl reads SOURCE_DATE_EPOCH
 * New switch --mark-from-image-descriptions-file: read file names from a description file and use them to mark current list files.
 * Introduced alphanumeric restriction in the descriptions shebang variables: must begin with underscore or alphabetic, continue with underscore or alphanumeric.
 * Keys '(' and ')' are now bound respectively to "goto '^p'" and "goto '$p'"; that is jump to first or last page.
 * Available symkeys are now documented in a section of man fimrc.
 * Switch -k --keysym-press <keysym> to simulate press of keysym at startup.
   Keysym can be prefixed by a repetition count number.
 * New switch  -/  <pattern> as short form of of -c /<pattern>.
 * New switch --// <pattern> as short form of of -c /<pattern> with _re_search_opts='f'.
 * Tehe space key (' ') is now assigned to 'scrollforward' (earlier was 's').
 * Introduced context prepend/append shebang syntax "#!fim:^=" and "#!fim:+=" in description files.
 * Switch --read-from-stdin-elds supports now the ASCII NUL terminator (via '').
 * Switch -V (--version) prints to stdout (not anymore to stderr).
 * The -B switch is now shorthand for --background-recursive.
 * If compiled in pre-C++11 flags, -B / --background-recursive behaves as -R.
 * Switch -S is now short form of --image-descriptions-file-separator (not anymore for --sanity-check).
 * Switch -D is now short form of --load-image-descriptions-file (not anymore for --dump-default-fimrc).
 * Switch -L/--read-from-file: read an image list from file (similarly to the - switch).
 * Now caching of mipmaps is on by default; can be turned off with new variable '_cache_control'.
 * Variable "_push_pushes_dirs"; if it is 2, also push hidden files and directories; that is, ones whose names begin with a dot (.).
 * configure --with-font-magnifying-factor=FACTOR controls text magnification by an integer factor.
   If FACTOR is positive, this value is hardcoded and cannot be changed at runtime.
   If FACTOR is negative, -FACTOR is default, but can be changed at runtime.
   If FACTOR is 0 (default) a default of 1 applies, and can be changed at runtime.
   This option is meant to be used on configurations with high resolutions and small consolefonts.
 * configure --with-tmpfile specifies a new temporary directory. 
 * configure tries to detect curses/ncurses.
 * Fix: mouse movement under SDL used to trigger unnecessary screen redraws.
 * Fix: the last used image is to be evicted from the cache as last, after possibly prefetched images.
 * Fix: in configure script, the regex_t check was unnecessarily broken.
 * Fix: ./configure --disable-pcx was not properly disabling PCX format support
 * With C++11 flags, --background-recursive loads images in the background recursively (experimental, unfinished).
 * Use variable "i:_file_load_time" to store the time taken to load the file and decode the image.
 * Use variable "_use_mipmaps=2" to compute the mipmaps faster, using every fourth source pixel.  This can be a good solution for speeding up large photographs scaling.
 * Description files beginning with "#!fim:desc" (of whatever extension) can now be loaded as they were normal image files.
 * Add switch --reverse to reverse the file list.
 * Add switch --sort-mtime to sort file list according to modification time.
 * Add switch --sort-fsize to sort file list according to file size.
 * Command "list 'sort_mtime'" to sort file list according to modification time.
 * Command "list 'sort_fsize'" to sort file list according to file size.
 * Command "list 'mark' {args}" accepts now exactly what "limit {args}" does.
 * Command syntax 'list "markall"' introduced.
 * Command syntax 'list "dumpmarked"' and 'list "unmarkall"' introduced.
 * Command 'list "swap"' introduced.
 * New '_lastgotodirection' variable, with the last file goto direction.
 * Key 'Enter' now marks and goes forward or back according to variable '_lastgotodirection'.
 * Fix: the largest mipmap was not always being used.
 * Fix: -lfl linkage is not really necessary: removed it.
 * Fix: support for PPM files with 2 bytes per sample.
 * Fix: a few more checks when reading PCX files.
 * Fix: documented that switch --sanity-check terminates the program, rather than continuing.
 * Fix: when stdint.h is available use uint8_t, uint16_t, uint32_t instead of non-portable __u8, __u16, __u32
 * Fix: compilation was broken without framebuffer (FIM_WITH_NO_FRAMEBUFFER)
 * Fix: cleaned up the internal keysyms initialization code.
 * Fix: removed obsolete documentation for the "window" command, now disabled.
 * Bugfix: improve GIF error handling.
 * Bugfix: on certain framebuffer configurations part of the screen was not being redrawn.
 * Bugfix: conversion from external program was vulnerable to failure due to a missing check.
 * Bugfix: avoiding data corruption when handling %k expando.
 * Bugfix: repeating "recording 'repeat_last'" (default '.' key) by prepending a number now works.
 * Fix: configure uses `sdl-config --static-lib`.

                Version 0.5

 * -R / --recursive switch to turn on recursive push of command line specified directories
 * added --sort and --sort-basename to sort the images list
 * introduced mipmap mechanism (_use_mipmaps) for faster display/scaling of images
 * status bar customizable with _display_status_fmt and _info_fmt_str, which can be
   controlled by the use of special image variable specifiers ('expandos'):
    "%T" expando to get (and display) total memory used by the program 
    "%C" expando to get (and display) file/memory usage by image cache
    "%M" expando to get (and display) memory used by the current (displayed) image
    "%c" expando to get (and display) centering information
    "%m" expando to get (and display) current image mipmap occupation information
    "%k" expando to get (and display) current image i:_comment value
    "%?PRE?VAR?POST?" expando to get (and display) "PRE".i:VAR."POST"
    ...
 * search (and jump) on image descriptions via 'goto' and key '/'
 * when repeating search with 'repeat_last', will use last direction
 * '?' key is now assigned to backward search (goto '-//')
 * default 'C-p' key is now assigned to repeat last backward search (goto '-//')
 * image cache will remember alignment within viewport
 * jump back and forth from the last viewed image with the ' (single quote aka apostrophe)
   key and the _lastfileindex variable
 * added --load-image-descriptions-file (equivalent to 'desc' 'load') to populate 
   the i:_comment values of each loaded image file and set _caption_over_image=2
   (with it added also --image-descriptions-file-separator)
 * added the 'desc "load"' command to load a textual files comments description file
 * introduced a 'limit' command, with comment, file name, or marked file criteria
 * the '`' key is bound to toggle limit'ing to the marked files list
 * introduced 'list "mark"' and 'list "unmark"' subcommands styled as 'limit'
 * load i:_comment and i:var from description file, with forms:
   "filename comment" (to i:_comment),
   "#!fim:var=value" (to   set i:var=value on all all the files following)
   "#!fim:var="      (to unset i:var=value on all all the files following)
   "filename #!fim:=" (to i:_comment from the value read last)
   "filename #!fim:+comment" (similar, but will append the new comment)
   "filename #!fim:^comment" (similar, but will prepend the new comment)
   "filename #!fim:s/f/t" (similar, but replace string f with string t)
 * EXIF tags will be read with libexif and become i:EXIF_-prefixed variables
 * if _want_exif_orientation is set, images will be reoriented according to EXIF
   metadata (i:__exif_orientation, i:__exif_mirrored, i:__exif_flipped).
 * the 'help' command will search also in fim command options
 * will optionally use C++11 constructs with ./configure --enable-cxx11 (no user level impact)
 * scaling image code faster (thanks to __restrict__ pointers)
 * customizable SDL window caption line with _want_wm_caption_status
 * BMP format support is now optional
 * PCX format support (optional)
 * changed meaning of variable _ignorecase: now it affects autocommands
 * introduced variable _re_search_opts affecting regexp-based search
 * default key 'r' is bound to 'rotate90', key 'R' to 'rotate270'
 * can be invoked without stdin; e.g. from an X menu
 * added "display 'resize'" to resize the SDL window, optionally to the image size
 * default SDL mode is windowed now
 * by default, the 'C-w' key will resize the SDL window to the original image size
 * by default, the 'W' key will resize the SDL window to the image size,
   and added an --autowindow switch to adapt window size to picture size
 * the 'help' command will search in help items if argument starts with /
 * special variable i:* expanding to all the variable name/value pairs of the current image
 * opening image files in archives (e.g. CBZ,CBR,RAR,TAR,fim-0.6-rc2.tar.gz,TBZ,7Z,ISO,...)
   with libarchive (experimental)
 * JPEG-2000 file support via JasPer (experimental)
 * added a ':- INTEGER' syntax, so one can specify the file in the list counting from the end
 * added an _archive_files variable to specify which file name types specify archives
 * added a 'list "pushdirr"' command, working like "pushdir" but recursively
 * the _fbfont variable will contain the current console font file string
 * mirror/flip are now being applied with respect to the viewport borders
 * stat() checking of files on load can be disabled with _push_checks
 * added --no-stat-push to set _push_checks=0 before initialization
 * added the _caption_over_image variable (which is 0 unless --load-image-descriptions-file)
 * 'Pause' and 'Menu' keys are now available in SDL (-o sdl) mode
 * added  'list' 'marked'  to show the list of marked files
 * key 'Del' bound to pop (delete) the current image from the list
 * i:_file loader will store the used loader string
 * switch --offset accepts a range now (using the new _open_offset_retry variable)
 * if an image has been opened with an offset, i:_open_offset will be set accordingly
 * variable i:pagecount is now replaced by i:pages
 * put aside (disabled) the v: b: and w: namespaces until they make more sense
 * panning on mouse movement in SDL mode
 * `make fim' goal has been deleted
 * changed librsb library detection: now it's e.g.:
   LIBS="`librsb-config  --ldflags --extra_libs` " CXXFLAGS="`librsb-config --cflags` "\
   ./configure --enable-matrices-rendering
 * bugfix: in some situations fim -o fb was not clearing the screen before drawing the image
 * bugfix in the "list 'remove'" internals
 * --binary=1/--binary=24 will not pad tiny renderings to _preferred_rendering_width pixels
 * fix: corrected the quiet mode (-q) to be quieter
 * fix: no zlib.h build time dependency (this will be reintroduced in the future)

                Version 0.4

 * changed --random semantics and introduced --random-no-seed switch
 * customizable status bar file info string
 * introduced --as-text to render printable bytes as text
 * key r is bound to 'rotate90', key R to 'rotate270'
 * bug fixes for the g: namespace, SDL/X mode, "list 'pop'" command, 
   the --offset option, 'ascale' and rotation, documentation.

                Version 0.4-beta

 * interface to the GraphicsMagic library (more graphics formats supported)
 * introduced bitwise AND and OR operators
 * support for rendering "matrix market" numerical matrix files (with librsb)
 * X mode not anymore default in aalib, available at option 
 * libjpeg usage fixes
 * libpng usage fixes (support for PNG_LIBPNG_VER>=10209)
 * documentation improvements (e.g.: fim man page is auto-generated)
 * "imlib2" X-based output device support 
 * "sdl" output device improvements (fullscreen/mouse/windowed options, I/O, ..)
 * more default consolefont options (e.g.: hardcoded consolefonts support)
 * configure option to disable the fim history file
 * improvements to scale, goto, other commands
 * improved directories reading
 * introduced --no-commandline, --no-internal-config switches
 * aggregated some commands for clarity
 * output console can be disabled at configure time
 * important fbdev bug fixes 
 * autocompletion of variable identifiers

                Version 0.3

 * minor strchr compilation problem on some systems
 * better consolefonts support  
 * much better SDL support (different color modes)
 * 'negate' feature
 * -S, or 'sanity-check' switch [changed meaning in v0.6]

               Version 0.3-beta-prerelease

 * auto-generated documentation: more consistency 
 * grammar specification, in man fimrc
 * internal commands,variables,autocommands  reference man page, in man fimrc
 * better internal help mechanisms
 * more control (resolution change,windowed mode) in experimental sdl mode
 * new commands (pread,reverse,shuffle,...) 
 * (temporarily) disabled internal windows splitting 
 * pushing files from a directory
 * several minor and major bugfixes

                Version 0.3-beta

 * full         support for AAlib (Ascii Art rendering) (-o aa)
 * experimental support for SDLlib (Simple Directmedia Layer) (-o sdl) (X!)
 * experimental PDF, PS, DJVU file support
 * history file support (~/.fim_history)
 * seamless caching and prefetching integration
 * viewing of any type files as bitmaps (unset bits black, set bits white)
 * viewing of any type files as pixmaps (as RGB triples)
 * framebuffer driver now can be disabled at compile time
 * colors inversion: saves a significant fraction of power when viewing documents 

                Version 0.3-alpha

 * experimental support for AAlib (Ascii Art rendering) (-t)
 * reading image files (-i) and scripts (-p) from stdin
 * runs on the powerpc architecure
 * rewritten from scratch the debug console, now buffered and with scrolling
 * achieved speedup in magnifying pictures
 * achieved speedup in displaying dithered images
 * smarter quoting rules (looser quote checking) when "push"ing files
 * dumping to file execution logs as executable scripts (-W/--write-scriptout)
 * implemented regular expressions matching operator (=~)
 * new default key bindings for split windows control
 * could be compiled with no readline library (--disable-readline)

                Version 0.2
 
 * internal windowing (with splitting, resizing, swapping) support
 * .xcf, .fig, .dia, .svg files now viewable via wrapper calls
 * introduced interactive command iteration ( in the [n]<command key> form )
 * fim will try to run under screen and over ssh now
 * custom framebuffer device, fonts and gamma are supported
 * enriched compile-time options via the ./configure script
 * vim-styled variable scoping g:,i:,v:,w: (local variables)
 * eradicated some bugs
 * introduced new variables, commands

                Version 0.2-alpha
 
 * first windowing functionalities
 * bugs and subtle flaws handling
 * introduced new variables, commands

                Version 0.1

 * regular expressions for filtering the viewed image list
 * vim-like autocommands
 * command line autocompletion
 * command line history
 * completely customizable key bindings
 * external/internal scriptability

 

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

Screenshots

A screenshot of a regular (framebuffer) FIM run (SDL would look the same)
A screenshot of a color ASCII Art FIM run:
A screenshot of a monochrome ASCII Art FIM run:
Both screenshots taken with the fbgrab program using the trunk version of FIM.
The top textual line was taken from the JPEG comment contained in the file; EXIF metadata is being displayed in the bottom textual line.
If you are curious, there are also textual and HTML renderings of the monochrome screenshots, and textual and HTML renderings of the coloured screenshots.

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

Links to documentation

If you wish to get an idea of FIM in action see these tutorials first.
If you consider building/installing by yourself then look at the README.html, (README) file.
Then there are the FIM man documentation (also on single page), the FIM language man documentation, (also on single page), the fimgs script man page (also on single page), and the doc/FIM.TXT documentation file (slightly outdated but still interesting --- look in the man pages first).
 
Here links to some relevant sections:

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

Download and build instructions

You are welcome to download the latest (prerelease, dated 24/09/2023) snapshot of FIM:
 
fim-0.6-rc2.tar.gz ( 919007 bytes )
 
and the signature file:
 
fim-0.6-rc2.tar.gz.sig .
If you want to be sure of the files authenticity, you should at least follow these steps:
wget http://download.savannah.nongnu.org/releases/fbi-improved/fim-0.6-rc2.tar.gz
wget http://download.savannah.nongnu.org/releases/fbi-improved/fim-0.6-rc2.tar.gz.sig
# Alternative A: import the key from a trusted keyserver by following on screen instructions:
gpg --search 0xE0E669C8EF1258B8
# Alternative B: import the key from FIM's website:
wget -O- https://www.nongnu.org/fbi-improved/0xE0E669C8EF1258B8.asc | gpg --import -  
gpg --verify fim-0.6-rc2.tar.gz.sig

 
The typical sequence of actions to build FIM, which should suffice is
tar xzf fim-0.6-rc2.tar.gz 
cd fim-0.6-rc2 
./configure --help=short 
# read the ./configure --help=short output: you can give options to ./configure
./configure 
make 
su -c "make install"

 
Read the documentation in order to properly install the dependencies.

 
If you are interested in compiling the freshest repository version, typing
svn export http://svn.savannah.nongnu.org/svn/fbi-improved/trunk fim
at the command prompt will export the freshest (possibly unstable) version of FIM in a directory named fim, and ready for compilation (see the documentation for details).

 

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

man fim

FIM

NAME
SYNOPSIS
DESCRIPTION
USAGE
OPTIONS
PROGRAM RETURN STATUS
COMMON KEYS AND COMMANDS
AFFECTING ENVIRONMENT VARIABLES
COMMON PROBLEMS
INVOCATION EXAMPLES
NOTES
BUGS
FILES
SEE ALSO
AUTHOR
COPYRIGHT

NAME

fim - Fbi (linux framebuffer imageviewer) IMproved, an universal image viewer

SYNOPSIS

fim [{options}] [--] {imagepath} [{imagepaths}]
fim --output-device {fb|sdl|ca|aa|imlib2|dumb} ...
... | fim [{options}] [--] [{imagepaths}] -
fim [{options}] [--] [{files}] - < {file_name_list_text_file}
fim --image-from-stdin [{options}] < {imagefile}
fim --script-from-stdin [{options}] < {scriptfile}
fim --help[=s|d|l|m] [{help-item} ...]

DESCRIPTION

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. Key bindings are customizable and specified in an initialization file. Interaction with standard input and output is possible (especially in shell scripts). An internal scripting language specialized for image viewing allows image navigation, scaling, manipulation of internal variables, command aliases, and vim-like autocommands. The internal language can be interacted with via a command line mode capable of autocompletion and history (the readline mode). Further features are display of EXIF tags, JPEG comments, EXIF rotation/orientation, load of "description files", faster load via image caching, command recording, and much more.

As a default, fim displays the specified file(s) on the detected, most convenient graphical device. This can be with SDL if running under X, an Ascii Art driver (aalib or libcaca) if running behind ssh without X forwarding, or the linux framebuffer device. Graphical file formats BMP, PCX are supported natively, while JPEG, PNG, GIF, TIFF, PPM, PGM, PBM are supported via third party libraries. Further formats are supported via external converters. For XCF (Gimp’s) images, will try to use ’xcftopnm’. For FIG vectorial images, will try to use ’fig2dev’. For DIA vectorial images, will try to use ’dia’. For SVG vectorial images, will try to use ’inkscape’. For other formats will try to use ImageMagick’s ’convert’ executable. The converter is given 15 seconds for the conversion before a timeout.

If {imagepath} is a file, its format is guessed not by its name but by its contents. See the _file_loader variable to change this default.

If {imagepath} is a directory, therein contained files of supported formats will be loaded. If {imagepath} contains a trailing slash (/), it will be treated as a directory; otherwise this will be checked via stat(2). To change this default, see description of the _pushdir_re variable and the --no-stat-push and --recursive options.

This man page describes fim command line options and usage. See man fimrc(5) for a full specification of the fim language, commands, keysyms, autocommands, variables, aliases, examples for a configuration file and readline usage samples.

USAGE

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.

See options --read-from-stdin, --script-from-stdin, and --image-from-stdin for more script-oriented usages.

The full commands specification is also accessible at runtime using the internal help system (typing :help).

OPTIONS

Accepted command line {options}:

--

Treat arguments after -- as filenames. Treat arguments before -- as command line options if these begin with -, and as filenames otherwise.

-a, --autozoom

Enable autozoom. fim will automagically pick a reasonable zoom factor when displaying a new image (as in fbi).

-b[24|1], --binary[=24|1]

Display contents of binary files (of any filetype) as these were raw 24 or 1 bits per pixel pixelmaps. Image width will not exceed the value of the _preferred_rendering_width variable. Regard this as an easter bunny option.

--as-text

Display contents of files (of any filetype) as these were text. Image width will not exceed the value of the _preferred_rendering_width variable. Non-printable characters will be displayed as " ". Regard this as another easter bunny option.

--cd-and-readdir

Step in the directory of the first file to be loaded, push other files from that directory, and jump back to the first file. Useful when invoking from a desktop environment.

-c {commands}, --execute-commands {commands}

Execute commands after reading the initialization file, just before entering the interactive mode. No semicolon (;) is required at the end of commands. Do not forget quoting commands in a manner suitable to your shell. So -c next is fine as it is. A more complicated example, with quotings: -c ’*2;2pan_up;display;while(1){align "bottom";sleep "1" ; align "top"}’ (with the single quotes) tells fim to: double the displayed image size, pan twice up, display the image, and finally do an endless loop consisting of bottom and top aligning, alternated.

-C {commands}, --execute-commands-early {commands}

Similar to the --execute-commands option, but execute commands earlier, just before reading the initialization file. The special ’early’ form =var=val will assign var to val immediately, before the interpreter is started.

For example, -C ’_scale_style=" "’ starts fim no auto-scaling; the equivalent early form is: -C ’=_scale_style= ’.

-d {framebuffer device}, --device {framebuffer device}

Framebuffer device to use. Default is the one your vc is mapped to (as in fbi).

--dump-reference-help[=man]

Dump to stdout language reference help and quit.

--dump-default-fimrc

Dump default configuration (the one hardcoded in the fim executable) to standard output and quit.

-E {scriptfile}, --execute-script {scriptfile}

Execute scriptfile after the default initialization file is read, and before executing --execute-commands commands.

-f {fimrc}, --etc-fimrc {fimrc}

Specify an alternative system-wide initialization file (default: /usr/local/etc/fimrc), to be read prior to any other configuration file. See also --no-etc-fimrc-file.

-F {commands}, --final-commands {commands}

Similar to the --execute-commands option, but execute commands after exiting the interactive mode, just before terminating the program.

-h[s|d|l|m], --help[=s|d|l|m]

Print program invocation help, and exit. Depending on the option, output can be: short, descriptive, long from man, or complete man. If further arguments follow, individual help messages will be shown instead.

-k {keysym}, --keysym-press {keysym}

Execute any command bound (via the bind command) to a specified keysym at startup. A keysym can be prefixed by a repetition count number. You can specify the option multiple times to simulate multiple keystrokes. Presses entered via --keysym-press are processed before presses entered via --chars-press. See man fimrc(5) for a list of keysyms and the use of bind.

-K {chars}, --chars-press {chars}

Input one or more keyboard characters at program startup (simulate keyboard presses). This option can be specified multiple times. Each additional time (or if the string is empty), a press of Enter (ASCII code 0x0D) key is prepended. Examples: -K ’’ simulates press of an Enter; -K ’:next;’ activates the command line and enter "next;" without executing it; -K ":next;" -K "next" executes "next", stays in the command line and enter keys "next"; -K ":next;" -K "" -K "next" executes "next", leaves the command line, and executes in sequence any command bound to keys ’n’, ’e’, ’x’, ’t’. Presses entered via --chars-press are processed after presses entered via --keysym-press.

-D {filename}, --load-image-descriptions-file {filename}

Load image descriptions from file filename. Each line begins with the basename of an image file, followed by a Tab character (or a different character if specified via --image-descriptions-file-separator), then the description text. The description text is copied into the i:_comment variable of the image at load time, overriding the comment possibly loaded from the file (e.g. JPEG, PNG or TIFF comment). If a ’@’ followed by and identifier {var} is encountered, and i:{var} is set, its value is substituted here. If "@#" is encountered, the remainder of the description line is ignored. Special comment lines like "#!fim:var=val" lead i:var to be assigned value val (unquoted) at image loading time (cached variable); i:var will not be assigned if var starts with an underscore (’_’). Special comment lines like "#!fim:+=val" add val to current description. Special comment lines like "#!fim:^=val" set val to be the base of each description. Special comment lines like "#!fim:!=" reset all cached variables. Special comment lines like "#!fim:/=dir" prepend dir to each file’s basename. Special comment lines like "#!fim:\=dir" prepend dir to each file’s name. Special description text (to be associated to an image) begins with markers: with "#!fim:=", the last description line is reused; with "#!fim:+", what follows is appended to the last description line; with "#!fim:^", what follows is prepended to the last description line; with "#!fim:s/f/t", the last description line will be used after substitution of occurrences of substring f with string t (f and t cannot contain newlines or a ’/’). If val is empty that variable is unset. These variables are stored also in an internal index used by the limit command. This option sets _caption_over_image=2, so that a caption is displayed over the image. A description file beginning with "#!fim:desc" can be loaded without specifying this switch.

-S {sepchar}, --image-descriptions-file-separator {sepchar}

A character to be used as a separator between the filename and the description part of lines specified just before a --load-image-descriptions-file.

-i, --image-from-stdin

Read one single image from the standard input (the image data, not the filename). May not work with all supported file formats. In the image list, this image takes the special name "<STDIN>".

--mark-from-image-descriptions-file {filename}

Set those files specified in filename (see --load-image-descriptions-file for the file format) as marked (see the list command).

-m {vmode}, --mode {vmode}

Name of the video mode to use video mode (must be listed in /etc/fb.modes). Default is not to change the video mode. In the past, the XF86 config file (/etc/X11/XF86Config) used to contain Modeline information, which could be fed to the modeline2fb perl script (distributed with fbset). On many modern xorg based systems, there is no direct way to obtain a fb.modes file from the xorg.conf file. So instead one could obtain useful fb.modes info by using the (fbmodes (no man page AFAIK)) tool, written by bisqwit. An unsupported mode should make fim exit with failure. But it is possible the kernel could trick fim and set a supported mode automatically, thus ignoring the user set mode.

-N, --no-rc-file

No personal initialization file will be read (default is ~/.fimrc) at startup.

--no-etc-fimrc-file

No system-wide initialization file will be read (default is /usr/local/etc/fimrc) at startup. See also --etc-fimrc.

--no-internal-config

No internal default configuration at startup (uses internal variable _no_default_configuration). Will only provide a minimal working configuration.

--no-commandline

With internal command line mode disabled.

--no-history-save

Do not save execution history at finalization (uses internal variable _save_fim_history).

--no-history-load

Do not load execution history at startup.

--no-history

Do not load or save execution history at startup.

-p, --script-from-stdin

Read commands from stdin before entering in interactive mode.

-o [fb|sdl|ca|aa|imlib2|dumb], --output-device
[fb|sdl|ca|aa|imlib2|dumb]

Will use the specified device as fim video output device, overriding automatic checks. The available devices depend on the original configuration/compilation options, so you should get the list of available output devices issuing fim --version. The fb option selects the Linux framebuffer. Presence of option S (e.g. fb=S) makes framebuffer initialization more picky: it will not tolerate running in a screen session. The ca option (coloured Ascii Art) can be specified as ca[={[’w’]}] ; if supplied, ’w’ selects windowed mode, provided libcaca is running under X; by default (or with ’W’), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. The aa (monochrome Ascii Art) option can be specified as aa[={[’w’|’W’]}]; if supplied, ’w’ selects windowed mode, provided aalib is running under X; by default (or with ’W’), windowed mode is being turned off internally during initialization by unsetting the DISPLAY environment variable. Please note that the readline (internal command line) functionality in ca and aa modes is limited. The sdl option (graphical windowed mode) may be specified as sdl ={[’w’][’m’][’r’][’h’][’W’][’M’][’R’][’H’][width[:height]][’%’]}, where width and height are integer numbers specifying the desired resolution (if height not specified, it takes the value of width); the ’w’ character requests windowed mode (instead of ’W’ for fullscreen); the ’m’ character requests mouse pointer display; the ’h’ character requests help grid map draw (can be repeated for variants); the ’r’ character requests support for window resize; the ’%’ character requests to treat width and height as percentage of possible window resolution. The same letters uppercase request explicit negation of the mentioned features. The imlib2 option requests imlib2 and is unfinished -- do not use it. The dumb test mode is not interactive.

--offset {bytes-offset[{:upper-offset}|{+offset-range}]}

Use the specified offset (in bytes) for opening the specified files. If :upper-offset is specified, further bytes until upper-offset will be probed. If +offset-range is specified instead, that many additional bytes will be probed. Use this option to search damaged file systems for image files. Appending a modifier among K,M,G (case irrelevant) to an offset number changes the unit to be respectively 2^10, 2^20, or 2^30 bytes.

--pread-cmd {cmd-filter-pipeline}

Specify a shell command with {cmd-filter-pipeline}. If the current filename matches "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$", it will be substituted to any occurrence of ’{}’. The resulting command output is assumed to be file data, which will be read and displayed. This works by setting the internal _pread_cmd variable (empty by default).

-P, --text-reading

Enable textreading mode. This has the effect that fim will display images scaled to the width of the screen, and aligned to the top. If the images you are watching are text pages, all you have to do to get the next piece of text is to press space (in the default key configuration, of course).

-s {value}, --scroll {value}

Set scroll steps for internal variable _steps (default is 20%).

--slideshow {number}

Interruptible slideshow mode. Wait for {number} of seconds (assigned to the _want_sleep_seconds variable) after each image. Implemented by executing reload; i:fresh=1; while(_fileindex <= _filelistlen-_loop_only_once){sleep _want_sleep_seconds; next;} sleep _want_sleep_seconds; as a first command. Can be interrupted by : or Esc. The other keys will execute accordingly to their function but will not interrupt the slideshow. Like in fbi, this will cycle forever, unless --once is specified.

--sanity-check

Perform a quick sanity check, just after the initialization, and terminate.

-t, --no-framebuffer

fim Use an ASCII Art driver. If present, use either of libcaca (coloured), or aalib (monochrome). For more, see (man fimrc), (info aalib) or (apropos caca)). If no ASCII Art driver was enabled at compile time, fim will not display any image at all.

-T {terminal}, --vt {terminal}

The terminal will be used as virtual terminal device file (as in fbi). See (chvt (1)), (openvt (1)) for more info about this. Use (con2fb (1)) to map a terminal to a framebuffer device.

--reverse

Reverse files list before browsing (can be combined with the other sorting options).

--sort

Sort files list before browsing according to full filename.

--sort-basename

Sort files list before browsing according to file basename’s.

--sort-mtime

Sort files list before browsing according to file modification time.

--sort-fsize

Sort files list before browsing according to file size.

-u, --random

Randomly shuffle the files list before browsing (seed depending on time() function).

--random-no-seed

Pseudo-random shuffle the files list before browsing (no seeding).

-v, --verbose

Be verbose: show status bar.

--verbose-load

Load files verbosely (repeat option to increase verbosity).

--verbose-font-load

Load font verbosely (sets _fbfont_verbosity).

--verbose-interpreter

Execute interpreter verbosely (Sets immediately _debug_commands="ackC" if specified once, _debug_commands="ackCi" if specified twice).

-V, --version

Print to stdout program version, compile flags, enabled features, linked libraries information, supported filetypes/file loaders, and then exit.

-w, --autowidth

Scale the image according to the screen width.

-=, --no-auto-scale

Do not scale the images after loading (will set ’_scale_style=" "’;).

--autowindow

Resize the window size (if supported by the video mode) to the image size. Don’t use this with other image scaling options.

--no-stat-push

Sets _push_checks=0 before initialization, thus disabling file/dir existence checks with stat(2) at push push time (and speeding up startup).

-H, --autoheight

Scale the image according to the screen height.

-W {scriptfile}, --write-scriptout {scriptfile}

All the characters that you type are recorded in the file {scriptout}, until you exit fim. This is useful if you want to create a script file to be used with "fim -c" or ":exec" (analogous to Vim’s -s and ":source!"). If the {scriptout} file exists, it will be not touched (as in Vim’s -w).

-L {fileslistfile}, --read-from-file {fileslistfile}

Read file list from a file: each line one file to load (similar to --read-from-stdin; use --read-from-stdin-elds to control line breaking).

-, --read-from-stdin

Read file list from stdin: each line one file to load; use with --read-from-stdin-elds to control line breaking).

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.

--read-from-stdin-elds {delimiter-char}

Specify an endline delimiter character for breaking lines read via -/--read-from-stdin/--read-from-file (which shall be specified after this). Line text before the delimiter will be treated as names of files to load; the text after will be ignored. This is also useful e.g. to load description files (see --load-image-descriptions-file) as filename list files. Default is the newline character (0x0A); to specify an ASCII NUL byte (0x00) use ’’.

-A, --autotop

Align images to the top border (by setting ’_autotop=1’ after initialization).

-q, --quiet

Quiet execution mode. Sets _display_status=0;_display_busy=0;.

-r {width:height}, --resolution {width:height}

Set resolution specification in pixels. Supported by SDL only. Will be appended to the argument to --output-device. Shorthand value ’fullscreen’ will be translated into ’W’.

-R[{exp}], --recursive[={exp}]

Push files/directories to the files list recursively. The expression in variable _pushdir_re (default: ".(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$") lists extensions of filenames which will be loaded in the list. You can overwrite its value by optionally passing an expression {exp} here as argument. If starting with ’+’ or ’|’, the expression following will be appended to it.

-X, --no-pipe-load

Do not load via external converter programs: only use built-in file decoders.

-B, --background-recursive

Push files/directories to the files list recursively, in background during program execution. Any sorting options will be ignored. Experimental feature, unfinished.

--load-shadow-directory {dir}

Add {dir} to the shadow directory list. Then ’scale "shadow"’ will temporarily substitute the image being displayed with that of the first same-named file located under a shadow directory. Useful to browse low-res images, but still being able to quickly view the hi-res original residing in a shadow directory. This works as intended as long as unique filenames are involved.

-/ {pattern}, --/ {pattern}

After startup jump to pattern; short for -c ’/’.

--// {pattern}

After startup jump to pattern; as -c ’/’ but with search on the full path (with _re_search_opts="f").

-1, --once

If running --slideshow, loop only once (as in fbi).

PROGRAM RETURN STATUS

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.

COMMON KEYS AND COMMANDS

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.*

2,4 stdout ’{}’

print three filenames to standard output.

!{syscmd}

executes the {syscmd} quoted string as an argument to the "system" fim 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.

AFFECTING ENVIRONMENT VARIABLES

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/kbd/consolefonts/cp866-8x16.psf.gz
/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".

SSH_TTY

if set and no output device specified, give precedence to ca, then aa (if present).

DISPLAY

If this variable is set, then the sdl driver will be probed by default.

COMMON PROBLEMS

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.

INVOCATION EXAMPLES

fim --help -R -B
# get help for options -R and -B

fim media/
# load files from the directory media/

fim -R media/ --sort
# open files found by recursive traversal of directory media, then sorting the list

find /mnt/media/ -name *.jpg | fim -
# read input files list from standard input

find /mnt/media/ -name *.jpg | shuf | fim -
# read input files list from standard input, randomly shuffled

cat script.fim | fim -p images/*
# read a script file script.fim from standard input before displaying files in the directory images

scanimage ... | tee scan.ppm | fim -i
# read the image scanned from a flatbed scanner as soon as it is read

h5topng -x 1 -y 2 dataset.hdf -o /dev/stdout | fim -i
# visualize a slice from an HDF5 dataset file

fim * > selection.txt
# output the file names marked interactively with the ’list "mark"’ command in fim to a file

fim * | fim -
# 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’
# 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

NOTES

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.

BUGS

fim has bugs. Please read the BUGS file shipped in the documentation directory to discover the known ones. There are also inconsistencies in the way the internal command line works across the different graphical devices.

FILES

/usr/local/share/doc/fim

The directory with fim documentation files.

/usr/local/etc/fimrc

The system-wide fim initialization file (executed at startup, after executing the hardcoded configuration).

~/.fimrc

The personal fim initialization file (executed at startup, after the system-wide initialization file).

~/.fim_history

File where to load from or save. See (man fimrc(5), man readline(3)).

~/.inputrc

If fim is built with GNU readline support, it will be susceptible to chages in the user set ~/.inputrc configuration file contents. For details, see (man readline(3)).

SEE ALSO

Other fim man pages: fimgs(1), fimrc(1).
Conversion programs: convert(1), dia(1), xcftopnm(1), fig2dev(1), inkscape(1).
Related programs: fbset(1), con2fb(1), vim(1), mutt(1), exiftool(1), exiftags(1), exiftime(1), exifcom(1), fbi(1), fbida(1), feh(1), fbgrab(1).
Related documentation: fbdev(4), vcs(4), fb.modes(8), fbset(8), setfont(8).

AUTHOR

Michele Martone <dezperado _CUT_ autistici _CUT_ org> is the author of fim, "fbi improved".

COPYRIGHT

Copyright (C) 2007-2023 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.



 

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

man fimrc

fimrc

NAME
SYNOPSIS
DESCRIPTION
FIM LANGUAGE GRAMMAR
COMMANDS REFERENCE
KEYSYMS REFERENCE
AUTOCOMMANDS REFERENCE
VARIABLES REFERENCE
DEFAULT ALIASES REFERENCE
COMMAND LINE USAGE EXAMPLES
CONFIGURATION FILE EXAMPLE
NOTES
BUGS
SEE ALSO
AUTHOR
COPYRIGHT

NAME

fimrc - fim configuration file and language reference

SYNOPSIS

~/.fimrc
/usr/local/etc/fimrc
fim --script-from-stdin [ {options} ] < {scriptfile}
fim --execute-script {scriptfile} [ {options} ]
fim --execute-commands {commands} [ {options} ]
fim --final-commands {commands} [ {options} ]
fim --write-scriptout {scriptfile} [ {options} ]
fim --write-scriptout /dev/stdout [ {options} ]
fim --chars-press :{commands} [ {options} ]
fim --chars-press :{commands} --chars-press ’’ [ {options} ]

DESCRIPTION

This page explains the fim language, which is used for the fimrc configuration files, {scriptfile}s, or {commands} passed via command line {options}. This language can be used to issue commands (or programs) from the internal program command line accessed interactively through the ":" key (or rather, the key code specified by the "_console_key" variable). One may exit from command line mode by pressing the Enter key on an empty line (a non empty command line would be submitted for execution), or the Esc key (only in SDL mode). The general form of a fim command/program is shown in the next section.

FIM LANGUAGE GRAMMAR

This section specifies the grammar of the fim language.

Language elements surrounded by a single quote ("’") are literals.

Warning: at the present state, this grammar has conflicts. A future release shall fix them.

program: %empty
| statement_list

statement_list: statement
| statement ’;’ statement_list
| non_atomic_statements_block statement_list
| statements_block

non_atomic_statements_block: ’{’ statement_list ’}’
| INTEGER ’{’ statement_list ’}’
| conditional_statement

statements_block: atomic_statements_block
| non_atomic_statements_block

conditional_statement: if_statement
| loop_statement

if_statement: ’if’ ’(’ expression ’)’ statements_block
| ’if’ ’(’ expression ’)’ statements_block ’else’ statements_block

loop_statement: ’while’ ’(’ expression ’)’ statements_block
| ’do’ statements_block ’while’ ’(’ expression ’)’

atomic_statements_block: statement ’;’
| statement ’;’ ’;’
| statement ’;’ ’;’ ’;’

statement: ’!’ arguments
| INTEGER ’,’ INTEGER IDENTIFIER
| INTEGER ’,’ INTEGER IDENTIFIER arguments
| INTEGER IDENTIFIER
| SLASH_AND_REGEXP
| ’+’ UNQUOTED_FLOAT ’%’
| ’+’ QUOTED_FLOAT ’%’
| ’+’ INTEGER ’%’
| ’*’ UNQUOTED_FLOAT
| ’*’ QUOTED_FLOAT
| ’*’ INTEGER
| UNQUOTED_FLOAT ’%’
| QUOTED_FLOAT ’%’
| INTEGER ’%’
| ’-’ UNQUOTED_FLOAT ’%’
| ’-’ QUOTED_FLOAT ’%’
| ’-’ INTEGER ’%’
| INTEGER
| ’-’ INTEGER
| IDENTIFIER
| IDENTIFIER FILE_PATH
| IDENTIFIER arguments
| INTEGER IDENTIFIER arguments
| IDENTIFIER ’=’ expression

arguments: expression
| expression arguments

expression: ’(’ expression ’)’
| expression ’.’ expression
| ’!’ expression
| expression ’%’ expression
| expression ’+’ expression
| expression ’-’ expression
| expression ’*’ expression
| expression ’/’ expression
| expression ’<’ expression
| expression ’>’ expression
| expression ’||’ expression
| expression BOR expression
| expression ’&&’ expression
| expression BAND expression
| expression ’>=’ expression
| expression ’<=’ expression
| expression ’!=’ expression
| expression ’==’ expression
| expression ’=~’ expression
| ’-’ expression
| IDENTIFIER
| INTEGER
| QUOTED_FLOAT
| UNQUOTED_FLOAT
| STRING

A STRING can be either a single quoted string or a double quoted string. A floating point number can be either unquoted (UNQUOTED_FLOAT) or quoted (QUOTED_FLOAT). A QUOTED_FLOAT is a floating point number, either single ("’") or double (""") quoted. An INTEGER shall be an unsigned integer number. An IDENTIFIER shall be one of the valid fim commands (see COMMANDS REFERENCE ) or a valid alias. A VARIABLE shall be an already declared or undeclared variable identifier (see VARIABLES REFERENCE ) or a valid alias, created using the alias command. The "=~" operator treats the right expression as a STRING, and uses it as a regular expression for matching purposes. The SLASH_AND_REGEXP is a slash ("/") followed by a STRING, interpreted as a regular expression. If ’INTEGER , INTEGER IDENTIFIER arguments’ is encountered, command IDENTIFIER will be repeated on each file in the interval between the two INTEGERs, and substituting the given file name to any ’{}’ found in the commands arguments (which must be quoted in order to be treated as strings). See regex(1) for regular expression syntax.

The way some one-line statements are evaluated:

: 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.*

2,4 stdout ’{}’

print three filenames to standard output.

!{syscmd}

executes the {syscmd} quoted string as an argument to the "system" fim command.

COMMANDS REFERENCE

alias
alias [{identifier} [{commands} [{description}]]]
Without arguments, lists the current aliases.
With one, shows an identifier’s assigned command.
With two, assigns to an identifier a user defined command or sequence of commands.
With three, also assigns a help string.

align
align [’bottom’|’top’|’left’|right’]: if image larger than drawing area, align one side of the image to the border.
align ’center’: align equally far from all sides.
align ’info’: print internal alignment information.

autocmd
autocmd {event} {pattern} {commands}: manipulate autocommands (inspired from Vim autocmd’s).
Without arguments, list autocommands.
With arguments, specifies for which type of event and which current file open, which commands to execute.
See the default built-in configuration files for examples.

autocmd_del
autocmd_del: specify autocommands to delete.
Usage: autocmd_del {event} {pattern} {commands}.

basename
basename {filename}: returns the basename of {filename} in the ’_last_cmd_output’ variable.

bind
bind [{keysym} [{commands}]]: bind a keyboard symbol/shortcut {keysym} to {commands}.
If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to.
Use the ’_verbose_keys’ variable to discover (display device dependent) raw keys.
Key binding is dynamical, so you can rebind keys even during program’s execution.
You can get a list of valid symbols (keysyms) by invoking dump_key_codes or in the man page.

cd
cd {path}: change the current directory to {path}.
If {path} is a file, use its base directory name.
cd ’-’ will change to the previous current directory (before the last ’:cd {path}’ command).

clear
clear: clear the virtual console.

commands
commands: display the existing commands.

color
color [desaturate]: desaturate the displayed image colors.
color [negate]: negate the displayed image colors.
color [colorblind|c|deuteranopia|d]: simulate a form of the deuteranopia color vision deficiency (cvd).
color [protanopia|p]: simulate a form of the protanopia cvd.
color [tritanopia|t]: simulate a form of the tritanopia cvd.
color [daltonize|D]: if following a cvd specification, will attempt correcting it.
color [identity]: populate the image with ’RGB identity’ pixels.
To get back the original you will have to reload the image.

crop
crop: crop image to a centered rectangle, half the width and half the height.
crop {p}: crop image to the middle {p} horizontal percent and {p} vertical percent of the image.
crop {w} {h}: crop image to the middle {w} horizontal percent and {h} vertical percent of the image.
crop {x1} {y1} {x2} {y2}: crop image to the area between the upper left ({x1},{y1}) and lower right ({x2},{y2}) corner.
Units are intended as percentage (0 to 100).
Note: still experimental functionality.

desc
desc ’load’ {filename} [{sepchar}]: load description file {filename}, using the optional {sepchar} character as separator.
desc ’reload’: load once again description files specified at the command line with --load-image-descriptions-file, with respective separators.
desc [’-all’] [’-append’] [’-nooverw’] ’save’ {filename} [{sepchar}]: save current list descriptions to file {filename}, using the optional {sepchar} character as separator, and if ’-all’ is present will save the variables, and if ’-append’ is present, will only append, and if ’-nooverw’ is present, will not overwrite existing files.
See documentation of --load-image-descriptions-file for the format of {filename}.

display
display [’reinit’ {string}]|’resize’ {w} {h}]: display the current file contents.
If ’reinit’ switch is supplied, the ’{string}’ specifier will be used to reinitialize (e.g.: change resolution, window system options) the display device.
See documentation for the --output-device command line switch for allowed values of {string}.
If ’resize’ and no argument, will ask the window manager to size the window like the image.
If ’resize’ and two arguments, these will be used as width and height of window, to set.

dump_key_codes
dump_key_codes: dump the active key codes (unescaped, for inspection purposes).

echo
echo {args}: print the {args} on console.

else
if(expression){action;}[’else’{action;}]: see else.

eval
eval {args}: evaluate {args} as commands, executing them.

exec
exec {filename(s)}: execute script {filename(s)}.

font
font ’scan’ [{dirname}]: scan {dirname} or /usr/share/consolefonts looking for fonts in the internal fonts list.
font ’load’ {filename}: load font {filename}.
font ’next’/’prev’: load next/previous font in the internal fonts list.
font ’info’: print current font filename.

getenv
getenv {identifier}: create a variable with the same value as the ’{identifier}’ environment variable, but with an identifier prefixed by ’ENV_’. So e.g. getenv ’DISPLAY’ creates ’ENV_DISPLAY’. Nothing is being printed; no variable is created if {identifier} is empty.

goto
goto {[’+’|’-’]{number}[’%’][’f’|’p’|’F’|’P’]} | {/{regexp}/} | {?{filename}} | {’+//’} | {’+/’|’-/’}[C] | {{’+’|’-’}{identifier}[’+’]}: jump to an image.
If {number} is given, and not surrounded by any specifier, will go to image at index {number}.
If followed by ’%’, the effective index will be computed as a percentage to the current available images.
If prepended by ’-’ or ’+’, the jump will be relative to the current index.
The ’f’ specifier asks for the jump to occur within the files (same for ’F’, but accelerates if keep pressing).
The ’p’ specifier asks for the jump to occur in terms of pages, within the current file (same for ’P’, but accelerates if keep pressing).
If /{regexp}/ is given, will jump to the first image matching the given /{regexp}/ regular expression pattern.
If the argument starts with ?, jump to the filename following ?.
If given ’+//’, will jump to the first different image matching the last given regular expression pattern.
With ’+/’C or ’-/’C will jump to next or previous file according to C: if ’s’ if same directory, if ’d’ if down the directory hierarchy, if ’u’ if down the directory hierarchy, if ’b’ if same basename, if upper case match is negative, if missing defaults to ’S’ (jump to file in different dir).
If {identifier|identifier2...}] is encountered after a ’+’ or ’-’ sign, jump to next or previous image having a different value for any corresponding i:{identifier} (a trailing ’+’ will require a non empty value).
Match will occur on both file name and description, possibly loaded via desc or --load-image-descriptions-file; see also ’_lastgotodirection’ and ’_re_search_opts’.
You can specify multiple arguments to goto: those after the first triggering a jump will be ignored.
Executes autocommands for events PreGoto and PostGoto. Keeping pressed shall accelerate images browsing.

help
help [{identifier}]: provide online help, assuming {identifier} is a variable, alias, or command identifier.
If {identifier} begins with ’/’, the search will be on the help contents and a list of matching items will be given instead.
A list of commands can be obtained simply invoking ’commands’; a list of aliases with ’alias’; a list of bindings with ’bind’.

if
if(expression){action;}[’else’{action;}]: see ’else’.

info
info: display information about the current file.

limit
limit {’-list’|’-listall’} ’variable’|[’-further’|’-merge’|’-subtract’] [{expression} |{variable} {value}]: A browsable file list filtering function (like limiting in the ’mutt’ program). Uses information loaded via --load-image-descriptions-file.
If invoked with ’-list’/’-listall’ only, will list the current description variable ids.
If invoked with ’-list’/’-listall’ ’id’, will list set values for the variable ’id’.
If ’-further’ is present, will start with the current list; if not, with the full list.
If ’-merge’ is present, new matches will be merged in the existing list and sorted.
If ’-subtract’ is present, sort and filter out matches.
If {variable} and {values} are provided, limit to files having property {variable} set to {value}.
If {expression} is one exclamation point (’!’), will limit to the currently marked files only.
If {expression} is ’~!’ will limit to files with unique basename.
if ’~=’, to files with duplicate basename.
if ’~^’, to the first of the files with duplicate basename.
if ’~$’, to the last of the files with duplicate basename.
On ’~i’ [MINIDX][-][MAXIDX], (each a number possibly followed by a multiplier ’K’) will limit on filenames in position MINIDX to MAXIDX.
On ’~z’ will limit to files having the current file’s size.
on ’~z’ [MINSIZE][-][MAXSIZE], (each a number possibly followed by a multiplier among ’k’,’K’,’m’,’M’) will limit on filesize within these limits.
on ’~d’ will limit to files having the current file’s date +- one day.
on ’~d’ [MINTIME][-][MAXTIME], (each the count of seconds since the Epoch (First of Jan. of 1970) or a date as DD/MM/YYYY) will limit on file time (struct stat’s ’st_mtime’, in seconds) within this interval.
For other values of {expression}, limit to files whose description string matches {expression}.
Invoked with no arguments, the original browsable files list is restored.

list
list: display the files list.
list ’random_shuffle’: randomly shuffle the file list.
list ’reverse’: reverse the file list.
list ’clear’: clear the file list.
list ’sort’: sort the file list.
list ’sort_basename’: sort the file list according to base name.
list ’sort_comment’: sort the file list according to the value of the _comment variable.
list ’sort_var’ {var}: sort the file list according to the value of the i:{var} variable.
list ’vars|variables’: list variables in all i:* read from description file.
list ’sort_fsize’: sort the file list according to file size.
list ’sort_mtime’: sort the file list according to modification date.
list ’pop’: remove the current file from the files list, and step back.
list ’remove’ [{filename(s)}]: remove the current file, or the {filename(s)}, if specified.
list ’push’ {filename(s)}: push {filename(s)} to the back of the files list.
list ’filesnum’: display the number of files in the files list.
list ’mark’ [{args}]: mark image file names for stdout printing at exit, with {args} mark the ones matching according to the rules of the ’limit’ command, otherwise the current file.
list ’unmark’ [{args}]: unmark marked image file names, with {args} unmark the ones matching according to the rules of the ’limit’ command, otherwise the current file.
list ’marked’: show which files have been marked so far.
list ’dumpmarked’: dump to stdout the marked files (you will want usually to ’unmarkall’ afterwards).
list ’markall’: mark all the current list files.
list ’unmarkall’: unmark all the marked files.
list ’pushdir’ {dirname}: will push all the files in {dirname}, when matching the regular expression in variable _pushdir_re or, if empty, from constant regular expression ’.(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$’.
list ’pushdirr’ {dirname}: like pushdir, but will also push encountered directory entries recursively.
list ’swap’: will move the current image filename to the first in the list (you’ll have to invoke reload to see the effect).
Of the above commands, several will be temporarily non available for the duration of a background load (enabled by --background-recursive), which will last until _loading_in_background is 0.

load
load: load the image, if not yet loaded (see also ’reload’).
Executes autocommands for events PreLoad and PostLoad.

pan
pan {vsteps}% {hsteps}%: pan the image to {vsteps} percentage steps from the top and {hsteps} percentage steps from left.
pan {vsteps} {hsteps}: pan the image to {vsteps} pixels from the top and {hsteps} pixels from left.
pan {’down’|’up’|’left’|’right’|’ne’|’nw’|’se’|’sw’}[+-] [{steps}[’%’]]: pan the image {steps} pixels in the desired direction.
If the ’%’ specifier is present, {steps} will be treated as a percentage of current screen dimensions.
If {steps} is not specified, the ’_steps’ variable will be used.
If present, the ’_hsteps’ variable will be considered for horizontal panning.
A ’+’ or ’-’ sign at the end of the first argument will make jump to next or prev if border is reached.
If present, the ’_vsteps’ variable will be considered for vertical panning.
The variables may be terminated by the ’%’ specifier.
Executes autocommands for events PrePan and PostPan.

popen
popen {syscmd}: pipe a command, invoking popen(): spawns a shell, invoking ’{syscmd}’ and executing as fim commands the output of ’{syscmd}’.

pread
pread {args}: execute {args} as a shell command and read the output as an image file (using ’popen’).

prefetch
prefetch: prefetch (read into the cache) the two nearby image files (next and previous), for a faster subsequent opening.
Executes autocommands for events PrePrefetch and PostPrefetch.
See also the ’_want_prefetch’ variable.

pwd
pwd: print the current directory name, and updates the ’_pwd’ variable.

quit
quit [{number}]: terminate the program.
If {number} is specified, use it as the program return status.
Note that autocommand ’PostInteractiveCommand’ does not trigger after this command.

recording
recording ’start’: start recording the executed commands.
recording ’stop’: stop recording the executed commands.
recording ’dump’: dump in the console the record buffer.
recording ’execute’: execute the record buffer.
recording ’repeat_last’: repeat the last performed action.

redisplay
redisplay: re-display the current file contents.

reload
reload [{arg}]: load the image into memory.
If {arg} is present, will force reloading, bypassing the cache (see also ’load’).
Executes autocommands for events PreReload and PostReload.

rotate
rotate {number}: rotate the image the specified amount of degrees. If unspecified, by one. If you are interested in orthogonal rotations, see ’_orientation’ and related aliases.
Executes autocommands for events PreScale and PostScale.

scale
scale {[’+’|’-’]{value}[’%’]|’*’{value}|’w’|’h’|’a’|’b’|’+[+-*/]’|[’<’|’>’]|’shadow’}: scale the image according to a scale {value} (e.g.: 0.5,40%,’w’,’h’,’a’,’b’).
If given ’*’ and a value, will multiply the current scale by that value.
If given ’w’, will scale according to the screen width.
If given ’h’, scale to the screen height.
If given ’a’, to the minimum of ’w’ and ’h’.
If given ’b’, like ’a’, provided that the image width exceeds ’w’ or ’h’.
If {value} is a number, will scale relatively to the original image width.
If the number is followed by ’%’, the relative scale will be treated on a percent scale.
If given ’++’(’+-’), will increment (decrement) the ’_magnify_factor’, ’_reduce_factor’ variables by ’_scale_factor_delta’.
If given ’+*’(’+/’), will multiply (divide) the ’_magnify_factor’, ’_reduce_factor’ variables by ’_scale_factor_multiplier’.
If given ’<’ or ’>’, will shrink or magnify image using nearest mipmap (cached pre-scaled version). If given ’shadow’ as a parameter, search a same-named file in one of the directories specified to --load-shadow-dir.
Executes autocommands for events PreScale and PostScale.

scroll
scroll: scroll down the image, going next when hitting the bottom.
scroll ’forward’: scroll the image as we were reading left to right (see ’_scroll_skip_page_fraction’ variable).
Executes autocommands for events PrePan and PostPan.

set
set: returns a list of variables which are set.
set {identifier}: returns the value of variable {identifier}.
set {identifier} {commands}: sets variable {identifier} to value {commands}.

set_commandline_mode
set_commandline_mode: set console mode.

set_interactive_mode
set_interactive_mode: set interactive mode.

sleep
sleep [{number}=1]: sleep for the specified (default 1) number of seconds.

status
status: set the status line to the collation of the given arguments.

stderr
stderr {args}: writes to stderr its arguments {args}.

stdout
stdout {args}: writes to stdout its arguments {args}.

system
system {syscmd}: get the output of executing the {syscmd} system command. Uses the popen() system call. Usually popen invokes "/bin/sh -c {syscmd}". This might not handle a multi-word command; in that case you will have to put it into a script. See ’man popen’ for more.

variables
variables: display the existing variables.

unalias
unalias {identifier} | ’-a’: delete the alias {identifier} or all aliases (use ’-a’, not -a).

unbind
unbind {keysym}: unbind the action associated to a specified {keysym}
If {keysym} is at least two characters long and begins with 0 (zero), the integer number after the 0 will be treated as a raw keycode to bind the specified {keysym} to.
Use the ’_verbose_keys’ variable to discover (display device dependent) raw keys.

while
while(expression){action;}: A conditional cycle construct.
May be interrupted by hitting the ’Esc’ or the ’:’ key.

window
window {args}: this command is disabled.

KEYSYMS REFERENCE

" " "!" """ "#" "$" "%" "&" "’" "(" ")" "*" "+" "," "-" "." "/" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" ":" ";" "<" "=" ">" "?" "@" "A" "Any" "B" "BackSpace" "Backspace" "C" "C-a" "C-b" "C-c" "C-d" "C-e" "C-f" "C-g" "C-h" "C-i" "C-j" "C-k" "C-l" "C-m" "C-n" "C-o" "C-p" "C-q" "C-r" "C-s" "C-t" "C-u" "C-v" "C-w" "C-x" "C-y" "C-z" "D" "Del" "Down" "E" "End" "Enter" "Esc" "F" "F1" "F10" "F11" "F12" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" "G" "H" "Home" "I" "Ins" "J" "K" "L" "Left" "M" "N" "O" "P" "PageDown" "PageUp" "Q" "R" "Right" "S" "T" "Tab" "U" "Up" "V" "W" "X" "Y" "Z" "[" "\" "]" "^" "_" "’" "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" "{" "|" "}" "~"

AUTOCOMMANDS REFERENCE

Available autocommands are: PreScale, PostScale, PrePan, PostPan, PreRedisplay, PostRedisplay, PreDisplay, PostDisplay, PrePrefetch, PostPrefetch, PreReload, PostReload, PreLoad, PostLoad, PreGoto, PostGoto, PreConfigLoading, PostConfigLoading, PreHardcodedConfigLoading, PostHardcodedConfigLoading, PreUserConfigLoading, PostUserConfigLoading, PreGlobalConfigLoading, PostGlobalConfigLoading, PreInteractiveCommand, PostInteractiveCommand, PreExecutionCycle, PostExecutionCycle, PreExecutionCycleArgs, PreWindow, PostWindow, and they are triggered on actions as suggested by their name.
Those associated to actual commands are mentioned in the associated commands reference.

VARIABLES REFERENCE

If undeclared, a variable will evaluate to 0.

When assigning a variable to a string, use single or double quoting, otherwise it will be treated as a number.

The namespaces in which variables may exist are: current image, global. A namespace is specified by a prefix, which can be: ’i:’, be prepended to the variable name. The global namespace is equivalent to the empty one:’’. The special variable i:* expands to the collation of all the name-value pairs for the current image.

In the following, the [internal] variables are the ones referenced in the source code (not including the hardcoded configuration, which may be inspected and/or invalidated by the user at runtime).

_TERM [out,g:] the environment TERM variable.
__exif_flipped
[out,i:] flipping information, read from the EXIF tags of a given image.
__exif_mirrored
[out,i:] mirroring information, read from the EXIF tags of a given image.
__exif_orientation
[out,i:] orientation information in the same format of _orientation, read from the orientation EXIF tags (i:EXIF_Orientation).
_all_file_loaders
[out,g:] space-separated list of hardcoded file loaders usable with _file_loader.
_archive_files
[in,g:] Regular expression matching filenames to be treated as (multipage) archives. If empty, ".(RAR|ZIP|TAR|TAR.GZ|fim-0.6-rc2.tar.gz|TAR.BZ2|TBZ|TBZ2|CBR|CBZ|LHA|7Z|XAR|ISO)$" will be used. Within each archive, only filenames matching the regular expression in the _pushdir_re variable will be considered for opening.
_autocmd_trace_stack
[in,g:] dump to stdout autocommands (autocmd) stack trace during their execution (for debugging purposes).
_autodesaturate
[in,g:] if 1, will desaturate images by default.
_autoflip
[in,g:] if 1, will flip images by default.
_automirror
[in,g:] if 1, will mirror images by default.
_autonegate
[in,g:] if 1, will negate images by default.
_autotop
[in,g:] if 1, will align to the top freshly loaded images.
_buffered_in_tmpfile
[out,i:] if an image has been temporarily converted and decoded from a temporary file, its name is here.
_cache_control
[in,g:] string for cache control. if it starts with ’m’ mipmaps will be cached; if it starts with ’M’ then not. otherwise defaults will apply.
_cache_status
[out,g:] string with current information on cache status.
_cached_images
[out,g:] the number of images currently cached.
_caption_over_image
[in,g:] if set not to 0, will display a custom comment string specified according to the value of_caption_over_image_fmt; if larger than 1, with black background; if 3, image will be drawn possibly below. It will take at most half of the screen.
_caption_over_image_fmt
[in,g:] custom info format string, displayed in a caption over the image; if unset: i:_comment; otherwise a custom format string specified just as _info_fmt_str.
_command_expansion
[in,g:] if 1, will enable autocompletion (on execution) of alias and command strings.
_comment
[i:,out] the image comment, extracted from the image file (if any).
_console_buffer_free
[out,g:] amount of unused memory in the output console buffer.
_console_buffer_total
[out,g:] amount of memory allocated for the output console buffer.
_console_buffer_used
[out,g:] amount of used memory in the output console buffer.
_console_key
[in,g:] the key binding (an integer variable) for spawning the command line; will have precedence over any other binding.
_console_lines
[out,g:] the number of buffered output console text lines.
_console_offset
[in,out,g:] position of the text beginning in the output console, expressed in lines.
_debug_commands
[in,g:] debugging option string for printing out . if containing ’a’, print out autocmd info; if containing ’c’, print out each command; if containing ’k’, print out each pressed key; if containing ’j’, print interpreter internal steps; if containing ’B’, clear screen and print background loading files; if containing ’C’, print cache activity.
_device_string
[out,g:] the current display device string.
_display_as_binary
[in,g:] will force loading of the specified files as pixelmaps (no image decoding will be performed); if 1, using one bit per pixel; if 24, using 24 bits per pixel; otherwise will load and decode the files as usual.
_display_as_rendered_text
[in,g:] will force loading of the specified files as text files (no image decoding will be performed); if 1; otherwise will load and decode the files as usual.
_display_busy
[in,g:] if 1, will display a message on the status bar when processing.
_display_console
[in,g:] if 1, will display the output console.
_display_status
[in,g:] if 1, will display the status bar.
_display_status_bar
[in,g:] if 1, will display the status bar.
_display_status_fmt
[in,g:] custom info format string, displayed in the lower left corner of the status bar; if unset: full pathname; otherwise a custom format string specified just as _info_fmt_str.
_do_sanity_check
[in,experimental,g:] if 1, will execute a sanity check on startup.
_downscale_huge_at_load
[in,g:] if 1, will downscale automatically huge images at load time.
_exiftool_comment
[out,g:] comment extracted via the exiftool interface; see _use_exiftool.
_fbfont
[out,g:] The current console font file string. If the internal hardcoded font has been used, then its value is "fim://".
_fbfont_as_screen_fraction
[in,g:] The rendered text will be scaled at least to this (integer) fraction of the screen. Disable font autoscaling with -1. (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1).
_fbfont_magnify_factor
[in,g:] The rendered text will use a font magnified by this (integer) factor. Maximal value is "16". (Only enabled if configured with --with-font-magnifying-factor=FACTOR, with FACTOR<1).
_fbfont_verbosity
[in,g:] if > 0, verbose font loading
_file_load_time
[out,i:] time taken to load the file and decode the image, in seconds.
_file_loader
[in,i:,g:] if not empty, this string will force a file loader (among the ones listed in the -V switch output); [out] i:_file_loader stores the loader of the current image.
_fileindex
[out,g:] the current image numeric index.
_filelistlen
[out,g:] current image list length (number of visible images).
_filename
[out,i:] the current file name string.
_fim_bpp
[out,g:] the bits per pixel count.
_fim_default_config_file_contents
[out,g:] the contents of the default (hardcoded) configuration file (executed after the minimal hardcoded config).
_fim_default_grammar_file_contents
[out,g:] the contents of the default (hardcoded) grammar file.
_fim_scriptout_file
[in,g:] the name of the file to write to when recording sessions.
_fim_version
[out,g:] fim version number; may be used for keeping compatibility of fim scripts across evolving versions.
_hsteps
[in,g:] the default steps, in pixels, when panning images horizontally (overrides steps).
_ignorecase
[in,g:] if 1, will allow for case insensitive regexp-based match in autocommands (autocmd).
_info_fmt_str
[in,g:] custom info format string, displayed in the lower right corner of the status bar; may contain ordinary text and special ’expando’ sequences. These are: %p for current scale, in percentage; %w for width; %h for height; %i for image index in list; %k for the value of i:_comment (comment description) variable in square brackets; %l for current image list length; %L for flip/mirror/orientation information; %P for page information; %F for file size; %M for screen image memory size; %m for memory used by mipmap; %C for memory used by cache; %T for total memory used (approximation); %R for total max memory used (as detected by getrusage()); %n for the current file path name; %N for the current file path name basename; ; %c for centering information; %v for the fim program/version identifier string; %% for an ordinary %. A sequence like %?VAR?EXP? expands to EXP if i:VAR is set; EXP will be copied verbatim except for contained sequences of the form %:VAR:, which will be expanded to the value of variable i:VAR; this is meant to be used like in e.g. ’%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?’, where the EXIF-set variable EXIF_DateTimeOriginal (make sure you have libexif for this) will be used only if present.
_inhibit_display
[internal,g:] if 1, will inhibit display.
_last_cmd_output
[out,experimental,g:] the last command output.
_last_file_loader
[out,g:] after each image load, _last_file_loader will be set to the last file loader used.
_last_system_output
[out,experimental,g:] the standard output of the last call to the system command.
_lastfileindex
[out,g:] the last visited image numeric index. Useful for jumping back and forth easily between two images with ’goto _lastfileindex’.
_lastgotodirection
[out,g:] the last file goto direction (either string ’+1’ or string ’-1’).
_load_default_etc_fimrc
[in,g:] if 1 at startup, will load the system wide initialization file.
_load_fim_history
[in,g:] if 1 on startup, will load the ~/.fim_history file on startup.
_load_hidden_dirs
[in,g:] if not 1, when pushing directories/files, those whose name begins with a dot (.) will be skipped.
_loading_in_background
[out,g:] 1 if program has been invoked with --background-recursive and still loading in background.
_loop_only_once
[internal,g:] if 1 and doing a --slideshow, do it once.
_lwidth
[in,g:] if>0, will force the output console text width.
_magnify_factor
[in,g:] the image scale multiplier used when magnifying images size.
_max_cached_images
[in,g:] the maximum number of images after which evictions will be forced. Setting this to 0 (no limits) is ok provided _max_cached_memory is set meaningfully.
_max_cached_memory
[in,g:] the maximum amount of memory (in KiB) at which images will be continued being added to the cache. Setting this to 0 (no limit) will lead to a crash (there is no protection currently).
_max_iterated_commands
[g:] the iteration limit for N in "N[commandname]" iterated command invocations.
_min_cached_images
[in,g:] the minimum number of images to keep from eviction; if less than four can lead to inefficiencies: e.g. when jumping between two images, each time an erase and a prefetch of neighboring images would trigger. default value is 4.
_no_default_configuration
[in,g:] if 0, a default, hardcoded configuration will be executed at startup, after the minimal hardcoded one.
_no_external_loader_programs
[in,g:] if 1, no external loading programs will be tried for piping in an unsupported type image file.
_no_rc_file
[in,g:] if 1, the ~/.fimrc file will not be loaded at startup.
_open_offset
[in,optional,g:,i:] offset (specified in bytes) used when opening a file; [out] i:_open_offset will be assigned to images opened at a nonzero offset.
_open_offset_retry
[in,optional,g:] number of adjacent bytes to probe in opening the file.
_orientation
[internal,i:] Orthogonal clockwise rotation (orientation) is controlled by: ’i:_orientation’, ’g:_orientation’ and applied on a per-image basis. In particular, the values of the three variables are summed up and the sum is interpreted as the image orientation. If the sum is 0, no rotation will apply; if it is 1, a single ( 90’) rotation will apply; if it is 2, a double (180’) rotation will apply; if it is 3, a triple (270’) rotation will apply. If the sum is not one of 0,1,2,3, the value of the sum modulo 4 is considered. Therefore, ":i:_orientation=1" and ":i:_orientation=5" are equivalent: they rotate the image one time by 90’.
_pread_cmd
[in,g:] a user-specified shell command emitting an image on stdout, in a format readable by the convert utility. If the current filename matches "^[/A-Za-z0-9_.][/A-Za-z0-9_.-]*$", it will be substituted to any occurrence of ’{}’.
_preferred_rendering_dpi
[in,optional,g:] if >0, pdf, ps, djvu rendering will use this value for a default document dpi (instead of a default value).
_preferred_rendering_width
[in,optional,g:] if >0, bit based rendering will use this value for a default document width (instead of a default value).
_push_checks
[in,experimental,g:] if 1 (default), will check with stat() existence of input files before push’ing them (set this to 0 to speed up loading very long file lists; in these cases a trailing slash (/) will have to be used to tell fim a pathname is a directory). This only works after initialization (thus, after command line files have been push’ed); use --no-stat-push if you wish to set this to 0 at command line files specification.
_push_pushes_dirs
[in,g:] if 1, the push command will also accept and push directories (using pushdir). if 2, will also push hidden files/directories, that is, ones whose names begin with a dot (.).
_pushdir_re
[in] regular expression to match against when pushing files from a directory or an archive. By default this is ".(JPG|PNG|GIF|BMP|TIFF|TIF|JPEG|JFIF|PPM|PGM|PBM|PCX|WEBP)$".
_pwd
[out,g:] the current working directory; will be updated at startup and whenever the working directory changes.
_re_search_opts
[in,g:] affects regexp-based searches; if an empty string, defaults will apply; if contains ’i’ (’I’), case insensitive (sensitive) searches will occur; if contains ’b’, will match on basename, if contains ’f’ on full pathname.
_reduce_factor
[in,g:] the image scale multiplier used when reducing images size.
_retry_loader_probe
[in,g:] if 1 and user specified a file loader and this fails, will probe for a different loader.
_rows
[in,g:] if >0, will set the number of displayed text lines in the console.
_save_fim_history
[in,g:] if 1 on exit, will save the ~/.fim_history file on exit.
_scale_factor_delta
[in,g:] value used for incrementing/decrementing the scaling factors.
_scale_factor_multiplier
[in,g:] value used for scaling up/down the scaling factors.
_scale_style
[in,g:] if non empty, this string will be fed to the scale command; see its documentation for possible values.
_screen_height
[out] the screen height.
_screen_width
[out,g:] the screen width.
_scroll_skip_page_fraction
[int,g:] if >1, fraction of page which will be skipped in when scrolling (e.g. ’scrollforward’); if 1, auto chosen; if <1, disabled.
_seek_magic
[optional,g:] will seek a ’magic’ signature in the file after opening it, and will try decoding it starting within the range of that signature (use like this: fim -C ’_seek_magic=MAGIC_STRING;push filename’).
_status_line
[in,g:] if 1, will display the status bar.
_steps
[in,g:] the default steps, in pixels, when panning images.
_sys_rc_file
[in,g:] string with the global configuration file name.
_use_exiftool
[in,g:] if >0 and supported, exiftool will be used to get additional information. if 1, this will be appened to _comment; if 2, will go to _exiftool_comment.
_use_mipmaps
[in,g:] if >0, will use mipmaps to speed up downscaling of images (this has a memory overhead equivalent to one image copy); mipmaps will not be cached. If 2, will use every fourth source pixel instead of averaging (good for photos, not for graphs).
_verbose_errors
[in,g:] if 1, will display on stdout internal errors, while parsing commands.
_verbose_keys
[in,g:] if 1, after each interactive mode key hit, the console will display the hit key raw keycode.
_verbosity
[in,experimental,g:] program verbosity.
_vsteps
[in,g:] the default steps, in pixels, when panning images vertically (overrides steps).
_want_autocenter
[in,g:] if 1, the image will be displayed centered.
_want_exif_orientation
[in,g:] if 1, will reorient images using information from EXIF metadata (and stored in in __exif_orientation, __exif_mirrored, __exif_flipped ).
_want_prefetch
[in,g:] if 1, will prefetch further files just after display of the first file; if 2 (and configured with --enable-cxx11) will load in the background.
_want_sleep_seconds
[in,g:] number of seconds of sleep during slideshow mode.
_want_wm_caption_status
[in,g:] this works only if supported by the display device (currently only SDL). if set to a number that is not 0, will show the status (or command) line in the window manager caption; if set to a non-empty string, will interpret it just as a file info format string (see _info_fmt_str); if empty, will show the program version.
_want_wm_mouse_ctrl
[in,g:] if at least 9 chars long, enable mouse click/movement behaviour when in SDL mode; the 9 chars will correspond to a 3x3 screen clickable grid and the equivalent command keys; clicking middle or right button will toggle on-screen usage info.
angle
[in,out,i:] a floating point number specifying the rotation angle, in degrees.
ascale
[in,out,i:] the asymmetric scaling of the current image.
desaturated
[out,i:] 1, if the image is desaturated.
flipped
[out,i:] 1, if the image is flipped.
fresh
[in,out,i:,experimental] 1 if the image was loaded, before all autocommands (autocmd) execution.
height
[out,i:] the current image original height.
mirrored
[out,i:] 1, if the image is mirrored.
negated
[out,i:] 1, if the image is negated.
page
[out,experimental,g:] the current page.
pages
[out,experimental,i:] the current number of pages of an image.
random
[out] a pseudorandom number.
scale
[in,i:] the scale of the current image.
sheight
[out,i:] the current image scaled height.
swidth
[out,i:] the current image scaled width.
width
[out,i:] the current image original width.

DEFAULT ALIASES REFERENCE

Hardcoded aliases are:

alias "A" "’_autotop=1-_autotop;’"
alias "magnify" "scale ’+’" # magnify the displayed image by the _magnify_factor variable or {args}
alias "next" "goto ’+1’" # go to the next page or picture file
alias "next_file" "goto ’+1f’" # go to the next file in the list
alias "next_page" "goto ’+1p’" # go to the next page in the file
alias "prev" "goto ’-1’" # go to the previous page or picture file
alias "prev_file" "goto ’-1f’" # go to the previous file in the list
alias "prev_page" "goto ’-1p’" # go to the previous page in the file
alias "reduce" "scale ’-’" # reduce the displayed image by _reduce_factor or {args}
alias "scale_factor_decrease" "scale ’+-’" # subtract _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor
alias "scale_factor_grow" "scale ’+*’" # multiply the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier
alias "scale_factor_increase" "scale ’++’" # add _scale_factor_delta to the scale factors _reduce_factor and _magnify_factor
alias "scale_factor_shrink" "scale ’+/’" # divide the scale factors _reduce_factor and _magnify_factor by _scale_factor_multiplier

They can be redefined with alias or deleted with the unalias command.
Further default aliases are usually loaded at startup -- see the CONFIGURATION FILE EXAMPLE section below.

COMMAND LINE USAGE EXAMPLES

# jump to the third image:
3;
# jump to first image:
^;
# jump to last image:
$;
# magnify the image two times:
*2;
# scale the image to the 30% of the original:
30%;
# scale the image up by 30%:
+30%;
# scale the image down by 30%:
-30%;
# jump to the next image whose filename matches the ".*jpg" regular expression:
/.*jpg;
# executes the "date" system command
!"date";

CONFIGURATION FILE EXAMPLE

Part of the default configuration comes from the _fim_default_config_file_contents variable, shown here.
One can skip its loading by using the _no_default_configuration variable.

# $LastChangedDate: 2023-03-09 00:38:06 +0100 (Thu, 09 Mar 2023) $
# Contents of the default ’fimrc’ file, hardcoded in the fim executable.
# Read the documentation (man fimrc) to discover how to change this default hardcoded file and how to make your own.
# Note that usually a ~/.fimrc file is read after these options take effect, so you could reset all of this with ease.
# Lines beginning with a pound (#) are ignored by fim (they are treated as comments).
#
# Internal variables.
# Some of these variables influence fim’s behaviour (input variables), some are set by fim (output variables).
# It is wise the input variables are set at the beginning of the file, so the bottom may issue commands correctly affected by them.
if(_cache_control==’’){_cache_control=’m’;}
if(_debug_commands==’’){_debug_commands=’’;}
if(_command_expansion==’’){_command_expansion=1;}
if(_display_status==’’){_display_status=0;}
if(_max_cached_images==’’){_max_cached_images=5;}
if(_min_cached_images==’’){_min_cached_images=4;}
if(_max_cached_memory==’’){_max_cached_memory=81920;}
if(_max_iterated_commands==’’){_max_iterated_commands=100;}
if(_want_prefetch==’’){_want_prefetch=1;}
if(_no_external_loader_programs==’’){_no_external_loader_programs=0;}
if(_scale_style==’’){_scale_style=’b’;}
if(_save_fim_history==’’){_save_fim_history=1;}
if(_load_fim_history==’’){_load_fim_history=1;}
if(_verbose_keys==’’){_verbose_keys=0;}
if(_display_busy==’’){_display_busy=1;}
if(_ignorecase==’’){_ignorecase=1;}
if(_re_search_opts==’’){_re_search_opts=’bi’;}
if(_console_offset==’’){_console_offset=0;}
if(_console_key==’’){_console_key=58;}
if(_display_as_binary==’’){_display_as_binary=0;}
if(_push_checks==’’){_push_checks=1;}
#if(_want_wm_caption_status==’’){_want_wm_caption_status=0;}
if(_want_exif_orientation==’’){_want_exif_orientation=1;}
if(ascale==’’){ascale="1.0";}
if(_use_mipmaps==’’){_use_mipmaps=1;}
if(_downscale_huge_at_load==’’){_downscale_huge_at_load=1;}
if(_scroll_skip_page_fraction==’’){_scroll_skip_page_fraction=0;}
if(_want_wm_mouse_ctrl==’’){_want_wm_mouse_ctrl="’pP+a-=nN";}
#
# External variables (not used internally).
if(allow_round_scroll==’’){allow_round_scroll=0;}
if(console_scroll_n==’’){console_scroll_n=3;}
#
alias "toggleautoflip" "_autoflip=1-_autoflip" "";
alias "toggleautonegate" "_autonegate=1-_autonegate" "";
alias "toggleflip" "i:flipped=1-i:flipped" "toggles flipped property on the current image";
alias "flip" "toggleflip;redisplay" "flip the current image along the horizontal axis";
alias "fliponce" "flip;toggleflip" "flip, but just for one display";
alias "toggleautomirror" "_automirror=1-_automirror" "";
alias "togglemirror" "i:mirrored=1-i:mirrored" "toggles mirrored property on the current image";
alias "mirror" "togglemirror;redisplay" "mirror the image along the vertical axis" "";
alias "mirroronce" "mirror;togglemirror" "mirror, but just for one display";
alias ’toggleLimitMarked’ ’__pre_limit_fileindex=_fileindex;_limit_mode=1-_limit_mode; if(_limit_mode==1){limit "!";} else { limit; } if(_filelistlen<1){_limit_mode=0;limit;goto __pre_limit_fileindex;} i:fresh=1;redisplay; ’ "toggle between limiting file list to the marked files and the full list";
alias "unlimit" "limit" "calling limit with no arguments restores the original list";
# Warning : binding to C-s, C-z and C-c won’t make effect, as these
# codes are get caught by the console driver and will have no effect in fim.
# Moreover, C-z will crash fim and C-c will terminate it.
# Some other combinations (e.g.:C-l) may have similar problems in your console.
bind ’f’ "flip";
bind ’F’ "fliponce";
bind ’m’ "mirror";
bind ’M’ "mirroronce";
bind ’q’ "quit";
bind ’Esc’ "quit";
#bind ’n’ "next_file";
#bind ’n’ "next";
bind ’C-h’ "help";
#bind ’?’ "help"; # assigned to back-search
#bind ’/’ "help"; # assigned to forward-search
bind ’=’ "scale ’100%’";
#bind ’p’ "prev_file";
bind ’Del’ "list ’remove’;reload";
#bind ’s’ "list ’sort’";
bind ’ ’ "scroll ’forward’";
bind ’S’ "toggleDisplayStatus";
bind ’I’ "toggleautonegate";
bind ’i’ "color ’negate’;redisplay";
bind ’g’ "color ’desaturate’;redisplay";
bind ’[’ ’font_reduce;redisplay’;
bind ’]’ ’font_magnify;redisplay’;
bind ’|’ ’toggle_font_auto_scale;redisplay’;
bind ’{’ ’font "prev";redisplay’;
bind ’}’ ’font "next";redisplay’;
bind ’G’ "toggleDesaturate";
bind ’r’ "rotate90";
bind ’R’ "rotate270";
bind ’+’ "magnify";
bind ’a’ "scale ’a’";
bind ’H’ "scale ’H’";
bind ’Tab’ "toggleVerbosity";
bind ’Menu’ "toggleVerbosity";
bind ’v’ "toggleDisplayStatus";
bind ’A’ "A";
bind ’C-m’ "list ’mark’";
bind ’u’ "list ’unmark’";
bind ’Enter’ "list ’mark’;goto _lastgotodirection";
bind ’-’ "reduce";
bind "Up" "pan_up";
bind ’k’ "pan_up";
bind "Right" "pan_right";
bind ’l’ "pan_right";
bind "Down" "pan_down";
bind ’j’ "pan_down";
bind "Left" "pan_left";
bind ’h’ "pan_left";
bind ’t’ "align ’top’";
bind ’C-g’ "system ’fbgrab’ ’fim_’._device_string.’.png’"; # grab a screenshot
#bind ’C-r’ "recording ’start’";
bind ’C-r’ "reload ’’";
bind ’Q’ "recording ’stop’";
bind ’D’ "recording ’dump’";
bind ’E’ "recording ’execute’";
bind ’C-e’ "recording ’execute’";
bind ’C-x’ "recording ’execute’";
bind ’.’ "recording ’repeat_last’";
bind ’’’ "toggleLimitMarked";
alias "toggleVerbosity" "_display_console=1-_display_console;i:fresh=1;redisplay" "";
alias "toggleKeyVerbosity" "_verbose_keys=1-_verbose_keys;redisplay" "";
alias "toggleDesaturate" "_autodesaturate=1-_autodesaturate;redisplay" "";
alias "idempotent_cmd" "goto ’’";
#
# Autocommands examples:
#autocmd "PostInteractiveCommand" "fim.png" "echo ’\nmatched an interactive command on fim.png\n’";
#autocmd "PostDisplay" ".*png" "echo ’this is a png file’";
#autocmd "PostDisplay" ".*jpg" "echo ’this is a jpg file’";
#autocmd "PostDisplay" "" "echo ’\nthis is a file\n’";
#autocmd "PostGoto" "" "set_interactive_mode";
autocmd "PostGoto" "" "reload";
autocmd "PostWindow" "" "i:fresh=1;redisplay;";
autocmd "PreRedisplay" "" "i:_will_display=1";
autocmd "PreRedisplay" "" "if(_scale_style!=’’ && i:fresh){i:fresh=0;scale _scale_style ;i:fresh=0;}";
autocmd "PostRedisplay" "" "i:_will_display=0";
# Display device specific config
alias "aalib_fix_do" "{if(aascale==’’){ascale=’2.0’;}else{ascale=aascale;} i:fresh=1;display;if(_TERM=~’screen’){echo ’screen+aalib?expect binding problems!’}}" "See aalib_fix.";
alias "aalib_fix" "if(_device_string==’aa’){aalib_fix_do;scale ’a’;}" "When using the aalib (ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the ’aascale’ variable for an accurate scaling.";
alias "cacalib_fix_do" "{if(cacascale==’’){ascale=’1.18’;}else{scale=cacascale;} i:fresh=1;display;if(_TERM=~’screen’){echo ’screen+cacalib?expect binding problems!’}}" "See cacalib_fix.";
alias "cacalib_fix" "getenv ’DISPLAY’;if(_device_string==’caca’ && ENV_DISPLAY==’’){cacalib_fix_do;scale ’a’;}" "When using the libcaca (Coloured ASCII art) library we face a problem: glyph proportions are seldom square (as pixels are), and are tricky to detect; for this reason, we need to reshape the image with respect to the font ratio, but we have to make a guess in the scaling factor to compensate. If at runtime a better value is known for the terminal font height/with ratio, it may be fed in the ’cacascale’ variable for an accurate scaling.";
autocmd "PostReload" "" "aalib_fix";
autocmd "PostLoad" "" "aalib_fix";
autocmd "PostReload" "" "cacalib_fix";
autocmd "PostLoad" "" "cacalib_fix";
alias "refresh" "desc ’reload’;redisplay;" "reloads and displays image description";
bind "F5" "refresh";
bind "F11" "if(_device_string==’sdl’ && !_fullscreen){_old_sw=_screen_width;_old_sh=_screen_height;display ’reinit’ ’mW0:0’;_fullscreen=1;}else if(_device_string==’sdl’ && _old_sw*_old_sh*_fullscreen){display ’reinit’ ’rwm’._old_sw.’:’._old_sh;_fullscreen=0;}" "Toggles full screen. Will show mouse cursor in full screen.";

autocmd "PostReload" "" "i:fresh=1" ;
autocmd "PostScale" "" "if(0==i:_will_display){i:fresh=1;display;}" ;
autocmd "PostPan" "" "{i:fresh=1;display;}" ;
autocmd "PostReload" "" "if(i:fresh){redisplay;}";
autocmd "PostInteractiveCommand" "" "if(i:fresh){display;i:fresh=0;}";
autocmd "PostInteractiveCommand" "" "if(_want_prefetch>0){prefetch;}";
autocmd "PostInteractiveCommand" "" "if(_display_console==0 && i:fresh){redisplay;i:fresh=0;}";
autocmd "PostInteractiveCommand" "" "idempotent_cmd"; # Bug workaround: without it console scroll is broken.

alias "next10" "i=0;while(i<10){i=i+1;next;display;sleep ’1’;}" "goes forward 10 images";
alias "prev10" "i=0;while(i<10){i=i+1;prev;display;sleep ’1’;}" "goes backward 10 images";
bind ’N’ ’next10’;
bind ’P’ ’prev10’;
bind ’C-n’ "goto ’+//’";
bind ’C-p’ "goto ’-//’";
bind ’C-b’ "goto ’-//’"; # Warning: many configurations cannot detect C-b.
bind ’W’ "display ’resize’" "if supported, resizes the window to match the current image pixels size";
#bind ’C-w’ "scale ’100%’;display ’resize’" "if supported, scales the image to 100% and resizes the window to match its size (if fits)";
bind ’C-w’ "if(_scale_style!=’w’){_scale_style=’w’;scale ’w’;}else{_scale_style=’’;scale ’100%’;}" "scale to width";
alias "endless_slideshow" "while(1){display;sleep ’1’;next;}" "performs an automated slideshow, endlessly";
alias "bookview" "while(1){display;sleep ’2’;scroll ’down’;}" "";
alias "comicview" "while(1){display;sleep ’1’;scroll ’down’;}" "";
alias "read" "while(1){display;sleep ’1’;scroll ’forward’;}" "";
alias "slowread" "while(1){display;sleep ’2’;scroll ’forward’;}" "";
alias "fastread" "while(1){display;scroll ’forward’;}" "proceeds like in a book bug very fast";
alias "pornview" "echo ’press any key repeatedly to terminate’ ;endless_slideshow" "enters an endless slideshow";
autocmd "PreExecutionCycle" "/fbps-" "_display_busy=0;_display_status=0" ;
autocmd "PreExecutionCycle" "" "i:fresh=1;reload";
autocmd "PreExecutionCycle" "/fbps-.*ps001.png" "i:fresh=1;redisplay";
## Example in imposing a file loader to an extension:
#autocmd "PreReload" ".*mtx.gz" "_file_loader=’MatrixMarket’";
#autocmd "PostReload" ".*mtx.gz" "_file_loader=’’";
bind ’*’ "_display_console=0;toggleVerbosity;echo i:*";
bind ’w’ "scale ’w’";
bind ’<’ "rotate10_ccw;display";
bind ’>’ "rotate10;display";
bind ’_’ "_scale_style=’’;scale ’100%’";
bind ’,’ "_display_console=1;echo _last_system_output";
bind ’C-a’ "if(_scale_style!=’a’){_scale_style=’a’;scale ’a’;}else{_scale_style=’’;scale ’100%’;}" "scale to height";
#
alias "pan_nw" "pan ’nw’" "pans the image to the upper left";
alias "pan_ne" "pan ’ne’" "pans the image to the upper right";
alias "pan_se" "pan ’se’" "pans the image to the lower left";
alias "pan_sw" "pan ’sw’" "pans the image to the lower right";
alias "pan_down" "if(_display_console==0){pan ’down’;}else{scd;}" "pans the image down / scrolls console down";
alias "pan_up" "if(_display_console==0){pan ’up’ ;}else{scu;}" "pans the image up / scrolls console up";
alias "pan_left" "pan ’left’" "pans the image left";
alias "pan_right" "pan ’right’" "pans the image right";
alias "diagonal_nw" "pan_nw" "pans the image to the upper left";
alias "diagonal_ne" "pan_ne" "pans the image to the upper right";
alias "diagonal_se" "pan_se" "pans the image to the lower left";
alias "diagonal_sw" "pan_sw" "pans the image to the lower right";
bind ’d’ "diagonal_nw";
bind ’D’ "diagonal_se";
bind ’x’ "diagonal_ne";
bind ’X’ "diagonal_sw";
alias "toggleDisplayStatus" "_display_status=1-_display_status;redisplay" "";
alias "toggleDisplayBusy" "_display_busy=1-_display_busy" "";
alias "sort" "list ’sort’" "sorts the files list ordered";
bind ’o’ "sort";
bind ’b’ "prev";
bind ’B’ "toggleDisplayBusy";
alias "random_slideshow" "while(1){goto random;}" "performs a shuffled slideshow";
alias "rotate90_ccw" "i:_orientation=i:_orientation+3;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees counter clockwise";
alias "rotate90_cw" "i:_orientation=i:_orientation+1;i:fresh=1;i:fresh=1;redisplay" "rotate 90 degrees clockwise";
alias "rotate180" "i:_orientation=i:_orientation+2;i:fresh=1;i:fresh=1;redisplay" "rotate 180 degrees";
alias "rotate90" "rotate90_cw;display" "rotate 90 degrees clockwise";
alias "rotate270" "rotate90_ccw;display" "rotate 90 degrees counter clockwise";
alias "rotate10" "rotate ’10’;display" "rotate 10 degrees counter clockwise";
alias "rotate10_ccw" "rotate -10 ;display" "rotate 10 degrees clockwise";

bind ’K’ ’if(_display_console==0){echo i:_filename.": ".i:_comment;toggleVerbosity}else{toggleVerbosity;}’;
bind ’C-k’ ’crop’ # still experimental

alias ’cache’ ’echo _cache_status’ "displays cached images status";
bind ’c’ ’align "center"’;
alias ’widen’ ’i:ascale=i:ascale*"1.1";*1.0’ "widen the current image";
alias ’narrow’ ’i:ascale=i:ascale/"1.1";*1.0’ "narrow the current image";
bind ’y’ "widen" "widen horizontally the image";
bind ’Y’ "narrow" "shrink horizontally the image";
alias ’console_scroll_up’ ’if(_console_offset<_console_lines+console_scroll_n-_rows){_console_offset=_console_offset+console_scroll_n;}’ "scrolls up the virtual console";
alias ’console_scroll_down’ ’if(allow_round_scroll || (_console_offset>=console_scroll_n)){_console_offset=_console_offset-console_scroll_n;}’ "scrolls down the virtual console";
alias ’console_scroll_reset’ ’{_console_offset=0;}’;
alias ’scu’ ’console_scroll_up’ "";
alias ’scd’ ’console_scroll_down’ "";
alias ’scz’ ’console_scroll_reset’ "";
alias ’center’ ’align "center"’;
alias ’left’ ’align "left"’;
alias ’right’ ’align "right"’;
alias ’top’ ’align "top"’;
alias ’bottom’ ’align "bottom"’;
alias "font_magnify_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction-1;}else{_fbfont_as_screen_fraction=_screen_width/100+_screen_height/100;}" "";
alias "font_magnify_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor+1" "";
alias "font_reduce_auto" "if(_fbfont_as_screen_fraction>1){_fbfont_as_screen_fraction=_fbfont_as_screen_fraction+1;}" "";
alias "font_reduce_manual" "_fbfont_magnify_factor=_fbfont_magnify_factor-1" "";
alias "toggle_font_auto_scale" "if(_fbfont_as_screen_fraction<0){_fbfont_as_screen_fraction=0;echo ’Auto font scaling on.’;}else{_fbfont_as_screen_fraction=-1;echo ’Auto font scaling off.’;}" "toggles between manual and auto font scaling control";
alias ’next_file_dir_same’ "goto ’+/s’;" "go to next file in same dir";
alias ’next_file_dir_other’ "goto ’+/S’;" "go to next file in other dir";
alias ’next_file_dir_up’ "goto ’+/u’;" "go to next file up the dir hierarchy";
alias ’next_file_dir_down’ "goto ’+/d’;" "go to next file down the dir hierarchy";
alias ’next_file_same_basename’ "goto ’+/b’;" "go to next file with same basename";
alias ’prev_file_dir_same’ "goto ’-/s’;" "go to prev file in same dir";
alias ’prev_file_dir_other’ "goto ’-/S’;" "go to prev file in other dir";
alias ’prev_file_dir_up’ "goto ’-/u’;" "go to prev file up the dir hierarchy";
alias ’prev_file_dir_down’ "goto ’-/d’;" "go to prev file down the dir hierarchy";
alias ’prev_file_same_basename’ "goto ’-/b’;" "go to prev file with same basename";
#alias "font_magnify" "if(_fbfont_as_screen_fraction<0) {font_magnify_manual;}else{font_magnify_auto;}" "increase font size (either relative or absolute)";
#alias "font_reduce" "if(_fbfont_as_screen_fraction<0) {font_reduce_manual;} else{font_reduce_auto;}" "increase font size (either relative or absolute)";
alias "font_magnify" "_fbfont_as_screen_fraction=-1;font_magnify_manual" "increase absolute font size and set manual font control";
alias "font_reduce" "_fbfont_as_screen_fraction=-1;font_reduce_manual" "decrease absolute font size and set manual font control";
bind "PageUp" "if(_display_console==0){prev;}else{scu;}";
bind "PageDown" "if(_display_console==0){next;}else{scd;}";
bind "Home" "0;";
bind "End" "$;";
bind "^" "0;";
bind "$" "$;";
#bind "Backspace" "prev"; # console code for C-h and Backspace is the same :-)
bind "’" "goto _lastfileindex";
bind ’"’ "scale ’shadow’;i:fresh=1;redisplay;";
bind ’(’ "goto ’^p’";
bind ’)’ "goto ’$p’";
bind ’Z’ "sleep 1";
_display_status=1; # lower status line
_want_wm_caption_status="fim:%N@%p%%%L[%i/%l]";
_info_fmt_str="%p%% %wx%h%L %i/%l%P %F %T %c"; # lower right line part
#_display_status_fmt="%N:%k"; #
_display_status_fmt="%N%?EXIF_DateTimeOriginal?[%:EXIF_DateTimeOriginal:]?%?EXIF_ExposureTime?[%:EXIF_ExposureTime:]?%?EXIF_FNumber?[%:EXIF_FNumber:]?%?EXIF_ApertureValue?[%:EXIF_ApertureValue:]?%?EXIF_ISOSpeedRatings?[ISO%:EXIF_ISOSpeedRatings:]?:%k"; # lower left line part
#_fbfont_as_screen_fraction=-1; # disable auto font scaling
echo "WELCOME: to switch to the command line interface press ’:’";
# More examples:
#alias "plisten" ’popen "nc -l -p 9999 "’ "executes fim commands coming from port 9999 on this computer";
#alias "wlisten" "while(1){sleep;plisten;}" "listen to a pipe, endlessly";
#alias "musicplay" "system ’mpc’ ’play’" "";
#alias "musicpause" "system ’mpc’ ’pause’" "";
#alias "rdjpgcom" ’system "rdjpgcom" i:_filename’;
# offsetscan usage : need a mechanism for popping all images before.
#alias "offsetscan" "while(i:width<1){list ’push’ ’blob.jpg’;stdout _open_offset ;_open_offset=_open_offset+1;reload;}";
#alias "webcam" "pread ’vgrabbj -d /dev/video0’";
#alias "webcam_cycle" "while(1){webcam;reload;sleep 1;}";
# This is a FIM initialization file.
# Without it FIM cannot work like it should.
# Feel free to modify it, but with caution!

NOTES

This manual page could be improved. Certain side effects of commands are not documented. Neither a formal description of the various commands. Interaction of commands and variables is also not completely documented.

BUGS

The fim language shall be more liberal with quoting.

SEE ALSO

fim(1), fimgs(1), regex(1).

AUTHOR

Michele Martone <dezperado _CUT_ autistici _CUT_ org>

COPYRIGHT

See copyright notice in fim(1).



 

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

man fimgs

fimgs

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO
AUTHOR

NAME

fimgs - poor man’s [http://]PostScript/pdf/dvi/cbr/rar/cbz/zip viewer based on fim

SYNOPSIS

fimgs [ {fimgs-options} ] file [-- [{fim-options}]]

DESCRIPTION

fimgs is a wrapper script which takes a PostScript or pdf or .cbr or .rar or .cbz or .zip or .dvi or any of the above prefixed with http:// or https:// or ssh: as input, renders the pages using ghostscript into a temporary directory and finally calls fim to display them.

In case of compressed archives (in ZIP or RAR formats), the images are decompressed into a directory and displayed using fim. In this case, only images contained in the archive will be displayed (no nested archives or pdf’s or ps’s or dvi’s).

The temporary directory name will be of the form $TMPDIR/fbps-$$. If the $TMPDIR environment variable is unset, /dev/shm and /var/tmp will be checked for existence and permissions. The $$ above is the script process ID. The script deletes the temporary directory when fim terminates.

In order to uncompress RAR archives, fimgs will use ’unrar-nonfree’ or ’rar’ or ’unrar-free’.

In order to uncompress ZIP archives, fimgs will use ’zip’.

In order to uncompress BZ2 files, ’bunzip2’ will be used, if present.

In order to uncompress TAR.GZ or TAR.BZ2 or TAR.XZ archives, fimgs will use ’tar’.

In order to fetch http:// or https:// prefixed URLS, ’wget’ will be used, if present.

In order to fetch ssh: prefixed host:path locations, ’scp’ will be used.

In case of a CBZ, CBR, PDF, PS, or DVI file, will invoke fim with ’--autotop --autowidth’.

OPTIONS

To pass through options to fim, you may specify them after "--".

Default options are ’--autozoom’.

-r {resolution} Specify resolution for the ’gs’ -r option (e.g.: 96x96; default 120x120).

-m

Dump a man page for fimgs.

-p {password}

Specify password for the ’gs’ -p (password) option.

-h

Will display a help message.

SEE ALSO

fim(1), fimrc(1), gs(1), fbi(1), fbgs(1), bash(1) ,zip(1), rar(1), rar-free(1), unrar-free(1), tar(1), gzip(1)

AUTHOR

Michele Martone <dezperado _ GUESS _ autistici.org>.



 

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

Copyright and Thanks

and derives from the Fbi image viewer by Gerd Hoffmann. See the README.TXT file for more licensing info.
	Thanks go to (in temporal order, newer to older):

Rafael Laboissiere, for several compatibility and correctness fixes
Martin Klaiber, for pointing out problems and testing
Mohammed Isam, for having provided PCX reading support
Matthieu Crapet, for enabling out-of-tree builds
Marco Barbàra, for testing and critiques
Vitaly Minko, for testing and debugging on ARM
Damiano Biagioli, for early testing
Marta Carbone, for early testing and debugging

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

License

FIM is free software, licensed under the terms of the GNU Public License version 2 (GPLv2) or later.
You find a FAQ about the GPL here.

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs

Bugs

There are notes about documented bugs in the BUGS.html (BUGS) file.
 
You are welcome to report bugs and propose patches only after reading the documentation.

sections: top tutorials news screenshots documentation download man fim man fimrc man fimgs copyright license bugs