FEH(1)

NAME
feh - image viewer and cataloguer

SYNOPSIS
feh [options] files or directories ...

VERSION
This manual documents feh 1.10.1

DESCRIPTION
feh is a mode-based image viewer. It is especially aimed at commandline users who need a fast image viewer without huge GUI dependencies, though it can also be started by (graphical) file managers to view an image.

feh supports filelists, various image sorting modes, image captions and more. Control happens via keyboard shortcuts; the mouse can also be used to control it, but is only required for very few actions.

MODES
feh is based on various modes, which are selected at startup by comandline options.

Slideshow mode is the default. It opens one window and displays the first image in it, the keyboard and mouse can be used to change slides (images). In slideshow mode, images can be deleted either from the filelist or from the disk, the new filelist can then be saved to the disk and reopened at a later time.

Montage mode forms a montage from the filelist. The resulting image can be viewed or saved, and its size can be limited by height, width or both.

Collage mode is very similar to montage mode, except the images are distributed randomly and may overlap each other.

Index mode forms an index print from the filelist. Image thumbnails are shown along with the filename, filesize and pixel size, printed using a truetype font of your choice. The resulting image can be viewed or saved, and its size can be limited by height, width or both.

Thumbnail mode is like index mode, but the mini-images are clickable and open the selected image in a new window.

Multiwindow mode shows images in multiple windows, instead of as a slideshow in one window. Don't use with a large filelist ;)

List mode doesn't display images. Outputs an ls - style listing of the files in the filelist, including image info such as size, pixels, type, etc. Customlist mode will display whatever image info you want, in the format you choose.

feh can also list either all the loadable files in a filelist or all the unloadable files. Useful for preening a directory.

OPTIONS

-A, --action [flag]action
    Specify a string as an action to perform on the image. In slideshow or multiwindow modes, the action will be run when the enter key is pressed, in list mode, the action will be run for each file listed. In loadables/unloadables mode, the action will be run for each loadable/unloadable file, respectively.

    If flag is "";, feh will not switch to the next image after executing the action.

    The action will be executed by /bin/sh. Use format specifiers to refer to image info. See FORMAT SPECIFIERS for examples. E.g. "feh -A mv ~/images/%n *". In slideshow mode, the next image will be shown after running the action, in multiwindow mode, the window will be closed.

--action1 .. --action9
    Extra actions which can be set and triggered using the appropiate number key.

-Z, --auto-zoom
    Zoom pictures to screen size in fullscreen (affected by --stretch and --ignore-aspect).

-x, --borderless
    Create borderless windows.

-Q, --builtin
    Use builtin HTTP client to grab remote files instead of wget(1).

-P, --cache-thumbnails
    Enable (experimental) thumbnail caching in ~/.thumbnails. Only works with thumbnails <= 256x256 pixels.

-K, --caption-path path
    Path to directory containing image captions. This turns on caption viewing, and if captions are found in path, which is relative to the directory of each image, they are overlayed on the displayed image. E.g. with caption path "captions/", and viewing image "images/foo.jpg", the caption will be looked for in "images/captions/foo.jpg.txt".

-c, --collage
    Enable collage mode. Collage mode is very similar to montage mode, except the images are distributed randomly. When using collage mode, you should also specify --limit-width and --limit-height.

-L, --customlist format
    Use format (printf-like string containing image info specifiers) for list output. See FORMAT SPECIFIERS.

--cycle-once
    Exit feh after one loop through the slideshow.

-G, --draw-actions
    Draw the defined actions and what they do at the top-left of the image.

-d, --draw-filename
    Draw the filename at the top-left of the image.

-f, --filelist file
    This option is similar to the playlists used by music software. If file exists, it will be read for a list of files to load, in the order they appear. The format is a list of image filenames, absolute or relative to the current directory, one filename per line. If file doesn't exist, it will be created from the internal filelist at the end of a viewing session. This is best used to store the results of complex sorts (-Spixels for example) for later viewing. Any changes to the internal filelist (such as deleting a file or it being pruned for being unloadable) will be saved to file when feh exits. You can add files to filelists by specifying them on the commandline when also specifying the list.

-e, --font font
    Set global font. Should be a truetype font, resident in the current directory or the font directory, and should be defined in the form fontname/points, like "myfont/12".

-C, --fontpath path
    Specify path as extra directory in which to search for fonts; can be used multiple times to add multiple paths.

-I, --fullindex
    Same as Index mode, but you also get image size and dimensions printed below each thumbnail.

-F, --fullscreen
    Make the window fullscreen.

-g, --geometry width x height
    Limit (and don't change) the window size. Takes an X-style geometry string like 640x480. Note that larger images will be zoomed out to fit but you can see them at 1:1 by clicking the zoom button.

-h, --help
    display help output and exit.

-Y, --hide-pointer
    Hide the pointer (useful for slideshows etc).

-B, --image-bg style
    Use style as background for transparent image parts and the like. Accepted values: white, black, default.

-i, --index
    Enable Index mode. Index mode is similar to montage mode, and accepts the same options. It creates an index print of thumbails, printing the image name beneath each thumbnail. Index mode enables certain other options, see INDEX MODE OPTIONS.

--index-dim bool
    Toggle showing image dimensions in thumbnail/index mode.

--index-name bool
    Toggle showing the filename in thumbnail/index mode.

--index-size bool
    Toggle showing the filesize in thumbnail/index mode.

--info commandline
    Execute commandline and display its output in the bottom left corner of the image. Can be used to display e.g. image dimensions or EXIF information. Supports FORMAT SPECIFIERS.

-k, --keep-http
    When viewing files using HTTP, feh normally deletes the local copies after viewing, or, if caching, on exit. This option prevents this so that you get to keep the local copies. They will be in /tmp with "feh" in the name.

-l, --list
    Don't display images. Analyse them and display an ls(1) - style listing. Useful in scripts to hunt out images of a certain size/resolution/type etc.

-U, --loadable
    Don't display images. Just print out their names if imlib2 can successfully load them.

-), --menu-bg file
    Use file as background image in menus.

-M, --menu-font font
    Use font (truetype, with size, like "yudit/12") as menu font.

--menu-style file
    Read file to determine menu style.

-m, --montage
    Enable montage mode. Montage mode creates a new image consisting of a grid of thumbnails of the images in the filelist. When montage mode is selected, certain other options become available. See MONTAGE MODE OPTIONS.

-w, --multiwindow
    Disable slideshow mode. With this setting, instead of opening multiple files in slideshow mode, multiple windows will be opened; one per file.

--no-jump-on-resort
    Don't jump to the first image after resorting the filelist.

-N, --no-menus
    Don't load or show any menus.

--no-screen-clip
    By default, window sizes are limited to the screen size. With this option, windows will have the size of the image inside them. Note that they may become very large this way, making them unmanageable in certain window managers.

--no-xinerama
    Disable Xinerama support. Only makes sense when you have Xinerama support compiled in.

-j, --output-dir directory
    Save files to directory (only useful with -k)

-p, --preload
    Preload images. This doesn't mean hold them in RAM, it means run through them and eliminate unloadable images first. Otherwise they will be removed as you flick through. This also analyses the images to get data for use in sorting, such as pixel size, type etc. A preload run will be automatically performed if you specify one of these sort modes.

-q, --quiet
    Don't report non-fatal errors for failed loads. Verbose and quiet modes are not mutually exclusive, the first controls informational messages, the second only errors.

-z, --randomize
    When viewing multiple files in a slideshow, randomize the file list before displaying.

-_, --rcfile file
    Use file to parse themes and options from, instead of the default ~/.fehrc, /etc/fehrc files.

-r, --recursive
    Recursively expand any directories in the commandline arguments to the content of those directories, all the way down to the bottom level.

-R, --reload int
    Reload images after int seconds. Mainly useful when viewing webcams via http.

-n, --reverse
    Reverse the sort order. Use this to invert the order of the filelist. E.g. to sort in reverse width order, use -nSwidth.

-., --scale-down
    When not in fullscreen: Scale images to screen size if they are too big.

-D, --slideshow-delay float
    For slideshow mode, wait float seconds between automatically changing slides. Useful for presentations. Specify a negative number to set the delay (which will then be float * (-1)), but start feh in paused mode.

-S, --sort sort_type
    The file list may be sorted according to image parameters. Allowed sort types are: name, filename, width, height, pixels, size, format. For sort modes other than name or filename, a preload run will be necessary, causing a delay proportional to the number of images in the list.

-|, --start-at filename
    Start the filelist at filename. See USAGE EXAMPLES.

-T, --theme theme
    Load options from config file with name theme - see CONFIG FILE SYNTAX for more info. Note that options from the theme file always override commandline options.

-t, --thumbnails
    Same as Index mode, but the thumbnails are clickable image launchers. Note that --fullscreen does not affect the thumbnail window. It does, however, work for the image windows launched from thumbnail mode.

-~, --thumb-title string
    Set title for windows opened from thumbnail mode. See also FORMAT SPECIFIERS.

-^, --title title
    Set window title. Applies to all windows except those opened from thumbnail mode. See FORMAT SPECIFIERS

-u, --unloadable
    Don't display images. Just print out their names if imlib2 can NOT successfully load them.

-V, --verbose
    output useful information, progress bars, etc.

-v, --version
    output version information and exit.

--zoom percent
    Zoom images by percent when in full screen mode or when window geometry is fixed. When combined with --auto-zoom, zooming will be limited to the specified percent.

BUTTON OPTIONS

-0, --reload-button int
    Set button to reload the image (default: 0).

-1, --pan-button int
    Set button to pan the image (hold button down and move mouse to move the image). When the mouse is not moved, advances to the next image in slideshow mode. (default: 1, usually the left button).

-2, --zoom-button int
    Set button to enable zoom mode (default: 2, usually the middle button).

-3, --menu-button int
    Set button to activate the menu. (default: 3, usually the right button).

--menu-ctrl-mask
    Require CTRL+Button for menu activation.

-4, --prev-button int
    Set button to switch to the previous image in slideshow mode (default: 4, usually <mousewheel up>).

-5, --next-button int
    Set button to switch to the next image in slideshow mode (default: 5, usually <mousewheel down>).

-8, --rotate-button int
    Use CTRL+Button to rotate the current image (default: 2).

--no-rotate-ctrl-mask
    Don't require CTRL+Button for rotation - just use the button.

-9, --blur-button int
    Use CTRL+Button for blurring (default: 1).

--no-blur-ctrl-mask
    Don't require CTRL+Button for blurring - just use the button.

MONTAGE MODE OPTIONS
These additional options can be used for montage, collage and (partially) thumbnail modes.

-a, --alpha int
    When drawing thumbnails onto the background, set their transparency level to int (0 - 255).

-b, --bg file | trans
    Use file as background for your montage. With this option specified, the montage size will default to the size of file if no size restrictions were specified. Alternatively, if file is "trans", the background will be made transparent.

-X, --ignore-aspect
    By default, the montage thumbnails will retain their aspect ratios, while fitting into thumb-width/-height. This options forces them to be the size set by --thumb-width and --thumb-height. This will prevent any empty space in the final montage.

-H, --limit-height pixels
    Limit the height of the montage. These options can be used together to define the image size exactly, or separately. If only one is specified, the other is calculated from the number of files specified and the size of the thumbnails. The default is to limit width to 800 pixels and calculate the height as necessary.

-W, --limit-width pixels
    Limit the width of the montage.

-o, --output file
    Save the created montage to file.

-O, --output-only file
    Just save the created montage to file without displaying it.

-s, --stretch
    Normally, if an image is smaller than the specified thumbnail size, it will not be enlarged. If this option is set, the image will be scaled up to fit the thumnail size. Aspect ratio will be maintained unles --ignore-aspect is specified.

-E, --thumb-height pixels
    Set thumbnail height.

-y, --thumb-width pixels
    Set thumbnail width.

-J, --thumb-redraw n
    Only relevant for --thumbnails: Redraw thumbnail window every n images. In feh <= 1.5, the thumbnail image used to be redrawn after every computed thumbnail (so, it updated immediately). However, since the redrawing takes quite long (especially for thumbnail mode on a large filelist), this turned out to be a major performance penalty. As a workaround, the thumbnail image is redrawn every 10th image now by default. Set n = 1 to get the old behaviour, n = 0 will only redraw once all thumbnails are loaded.

INDEX MODE OPTIONS

-@, --title-font font
    Set font to print a title on the index, if no font is specified, no title will be printed.

BACKGROUND SETTING
feh can also be used as a background setter. It will store the command line necessary to set the background in ~/.fehbg, so to have your background restored everytime you start X, you can add "`cat ~/.fehbg`" to your X startup script (like ~/.xinitrc).

The following options control how exactly the background is set. Each of them takes exactly one file as argument.

--bg-center
    Center the file on the background. If it is too small, it will be surrounded by a black border

--bg-fill
    Like --bg-scale, but preserves aspect ratio by zooming the image until it fits. Either a horizontal or a vertical part of the image will be cut off

--bg-max
    Like --bg-fill, but scale the image to the maximum size that fits the screen with black borders on one side.

--bg-scale
    Fit the file into the background without repeating it, cutting off stuff or using borders. But the aspect ratio is not preserved either

--bg-tile
    Tile (repeat) the image in case it is too small for the screen

FORMAT SPECIFIERS

%f  Image path/filename

%h  Image height

%l  Total number of files in filelist

%m  Current mode

%n  Image name

%p  Number of image pixels

%P  feh

%s  Image size in bytes

%t  Image format

%u  Number of current file

%w  Image width

%v  feh version

CONFIG FILE SYNTAX
The config file allows the naming of option groups, called themes. If ~/.fehrc or /etc/fehrc exist, feh will look in them for name/options pairs. If neither of them exist, feh will create a default one in ~/.fehrc.

It takes entries of the form "theme options ...", where theme is the name of the entry and options are the options which will be applied when the theme is used.

An example entry would be "imagemap -rVq --thumb-width 40 --thumb-height 30".

You cane use this theme in two ways. Either call " feh -Timagemap *.jpg " or create a symbolic link to feh with the name of the theme you want it to use. So from the example above: " ln -s `which feh ` ~/bin/imagemap ". Now just run "imagemap *.jpg" to use these options.

Note that you can split a theme over several lines by placing a backslash at the end of a line, like in the shell.

You can combine these themes with commandline options. An example .fehrc is provided with a couple of cool example themes.

KEYS
In an image window, the following keys may be used:

a   Toggle actions display (see --draw-actions)

c   Caption entry mode. If --caption-path has been specified, then this enables caption editing. The caption at the bottom of the screen will turn yellow and can be edited. Hit return to confirm and save the caption, or escape to cancel editing. Note that you can insert an actual newline into the caption using <CTRL+return>.

d   Toggle filename display (see --draw-filename)

f   Save the current filelist to a unique filename

h   Pause/Continue the slideshow. When it is paused, it will not automatically change slides based on --slideshow-delay.

m   Show menu. Use the arrow keys and return to select items, <escape> to close the menu.

n, <Space>, <Right>
    Show next image

o   Toggle pointer visibility

p, <Backspace>, <Left>
    Show previous image

q   Quit feh

r   Reload current image. Useful for webcams

s   Save the current image to a unique filename

v   Toggle fullscreen

w   Change window size to fit current image size

x   Close current window

z   Jump to a random position in the current filelist

<, >
    In place editing - rotate the images 90 degrees (counter)clockwise. The rotation is lossless, but may create artifacts in some image corners when used with JPEG images. Rotating in the reverse direction will make them go away. See jpegtran(1) for more about lossless JPEG rotation.

0 .. 9
    Execute the corresponding action (0 = --action, 1 = --action1 etc.)

<Return>
    Run the command defined by --action

<home>
    Show first image

<end>
    Show last image

<page up>
    Go forward ~5% of the filelist

<page down>
    Go backward ~5% of the filelist

<escape>
    Quit the slideshow

+   Increase reload delay

-   Decrease reload delay

<delete>
    Remove current file from filelist

<CTRL+delete>
    Remove current file from filelist and delete it

<keypad left>, <Ctrl+Left>
    Scroll to the left

<keypad right>, <Ctrl+Right>
    Scroll to the right

<keypad up>, <Ctrl+Up>
    Scroll up

<keypad down>, <Ctrl+Down>
    Scroll down

<keypad begin>
    Antialias the image

<keypad +>, <Up>
    Zoom in

<keypad ->, <Down>
    Zoom out

<keypad *>
    Zoom to 100%

<keypad />
    Zoom to fit the window size

MOUSE ACTIONS
When viewing an image, by default mouse button 1 pans (moves the image around) or, when only clicked, moves to the next image (slideshow mode only); button 2 zooms (click and drag left->right to zoom in, right->left to zoom out, click once to restore zoom to 100%); and mouse button 3 opens the menu.

CTRL+Button 1 blurs or sharpens the image (drag left to blur, right to sharpen); CTRL+Button 2 rotates the image around the center point.

A note about pan and zoom modes: In pan mode, if you reach a window border but haven't yet panned to the end of the image, feh will warp your cursor to the opposite border so you can continue panning.

When clicking the zoom button and immediately releasing it, the image will be back at 100% zoom. When clicking it and moving the mouse while holding the button down, the zoom will be continued at the previous zoom level. The zoom will always happen so that the pixel on which you entered the zoom mode remains stationary. So, to enlarge a specific part of an image, click the zoom button on that part.

SIGNALS
In slideshow mode, feh handles the following signals:

SIGUSR1
    Switch to next image

SIGUSR2
    Switch to previous image

USAGE EXAMPLES
Here are some examples of useful option combinations

feh /opt/images
    Show all images in /opt/images

feh -r /opt/images
    Recursively show all images found in /opt/images and subdirectories

feh -rSfilename /opt/images
    Same as above, but sort by filename. By default, feh will show files in the order it finds them on the hard disk, which is usually somewhat random.

feh -t -Sfilename -E 128 -y 128 -W 1024 /opt/images
    Show 128x128 pixel thumbnails, limit window width to 1024 pixels.

feh -t -Sfilename -E 128 -y 128 -W 1024 -P -C /usr/share/fonts/truetype/ttf-dejavu/ -e DejaVuSans/8 /opt/images
    Same as above, but enable thumbnail caching in ~/.thumbnails and use a smaller font.

feh -irFarial/14 -O index.jpg /opt/images
    Make an index print of /opt/images and all directories below it, using 14 point Arial to write the image info under each thumbnail. Save the image as index.jpg and don't display it, just exit. Note that this even works without a running X server

feh --unloadable -r /opt/images
    Print all unloadable images in /opt/images, recursively

feh -w /opt/images/holidays
    Open each image in /opt/images/holidays in its own window

feh -FD5 -Sname /opt/images/presentation
    Show the images in .../presentation, sorted by name, in fullscreen, automatically change to the next image after 5 seconds

feh -rSwidth -A "mv '%f' ~/images/'%n'" /opt/images
    View all images in /opt/images and below, sorted by width, move an image to ~/image/image_name when enter is pressed

feh --start-at ./foo.jpg.
    View all images in the current directory, starting with foo.jpg. All other images are still in the slideshow and can be viewed normally

feh --start-at foo.jpg *
    Same as above

feh --info "exifgrep '(Model|DateTimeOriginal|FNumber|ISO|Flash)' '%f' | cut -d. -f 4-".
    Show some EXIF information, extracted by exifprobe/exifgrep

DEPENDENCIES
feh requires the jpegtran binary (usually distributed in "libjpeg-progs" or similar) for lossless rotation.

To view images from URLs such as http://, you need to have wget available or use the builtin HTTP client (see --builtin).

BUGS
Xinerama support does not really work on Xinerama screens != 0.

Thumbnail mode is somewhat inefficient, and because of that not nearly as fast as it could be.

--scale-down does not support zooming.

  REPORTING BUGS
If you find a bug, please report it to <derf@finalrewind.org> or via <http://github.com/derf/feh/issues>

Please include the feh version <the output of "feh --version">, steps to reproduce the bug and (if necessary), images to reproduce it.

FUTURE PLANS
Plans for the following releases:
•   Switch to real config file from fehrc theme definitions
•   Add config options to rebind keys + proper mouse action rebinding
•   Make zoom options more intuitive

LICENSE
Copyright (C) 1999, 2000 by Tom Gilbert (and various contributors). Copyright (C) 2010 by Daniel Friesel (and even more contributors).

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies of the Software and its documentation and acknowledgment shall be given in the documentation and software packages that this Software was used.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current developer: Daniel Friesel <derf@finalrewind.org>

Original author (no longer developing): Tom Gilbert <feh_sucks@linuxbrit.co.uk>