feh is a mode-based image viewer. It is especially aimed at command line 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. By default (unless arguments or a filelist are specified) feh displays all files in the current directory.

feh supports filelists, various image sorting modes, image captions, HTTP and more. Configurable keyboard and mouse shortcuts are used to control it; by default, the mouse is only required for very few actions.

feh can also be used as wallpaper setter.

EXIF tags are supported either using exiv2 / exifgrep via --info (see the Usage Examplessection), or by compiling feh with exif=1.

feh is based on various modes, which are selected at startup by command line 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. An image can also be read from stdin via “feh -”.

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.

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.

feh can open any format supported by Imlib2, most notably jpeg and png. If the convert binary (supplied by ImageMagick) is available, it also has limited support for many other filetypes, such as svg, xcf and otf. Use --magick-timeoutnum with a non-negative value to enable it. For animated images, only the first frame is shown.

Specify a shell command as an action to perform on the image. In slideshow or multiwindow mode, the action will be run when the action_0 key is pressed, in list mode, it will be run for each file. In loadable/unloadable mode, it will be run for each loadable/unloadable file, respectively. In thumbnail mode, clicking on an image will cause the action to run instead of opening the image.

If flag is “;”, feh will reload the current image instead of switching to the next one (slideshow mode) or closing the window (multiwindow mode) after executing the action. If [title] is specified (note the literal “[” and “]”), --draw-actions will display title instead of action in the action list. Note that title must not start with a space. If it does, the action is handled as if it did not have a title. This special case exists for backwards compatibility reasons and makes sure that actions like “[ -L %F ] && foo” still work.

The action will be executed by /bin/sh. Use format specifiers to refer to image info, see Format Specifiers for details. Example usage: “feh -A “mv ~/images/%N” *”.

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

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 (-Spixelsfor 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 command line when also specifying the list.

Note: This option needs to load all images to calculate the dimensions of the feh window, so when using it with many files it will take a while before a feh window is visible. Use --preload to get a progress bar.

Make the window fullscreen. Note that in this mode, large images will always be scaled down to fit the screen, --zoomzoom only affects smaller images and never scales larger than necessary to fit the screen size. The only exception is a zoom of 100, in which case images will always be shown at 100% zoom, no matter their dimensions.

Limit (and don't change) the window size. Takes an X-style geometry string like 640x480 with optional +x+y window offset. Note that larger images will be zoomed out to fit, but you can see them at 1:1 by clicking the zoom button. Also note that this option does not enforce the geometry, changing it by a tiling WM or manually is still possible. After each resize, the resulting window size is used as the new size limit.

Enable Index mode. Index mode is similar to montage mode, and accepts the same options. It creates an index print of thumbnails, printing the image name beneath each thumbnail. Index mode enables certain other options, see Index Mode Options and Montage Mode Options.

Show image information based on format below thumbnails in index / thumbnail mode. See Format Specifiers. May contain newlines. Use “--index-info ‘’” to display thumbnails without any info text

Note: If you specify image-related formats (such as %w or %s), feh needs to load all images to calculate the dimensions of its own window. So when using them with many files, it will take a while before a feh window becomes visible. Use --preload to get a progress bar.

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. If flag is set to “;”, the output will not be displayed by default, but has to be enabled by the toggle_info key.

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.

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.

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.

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.

Scale images to fit window geometry (defaults to screen size when no geometry was specified). Note that the window geometry is not updated when changing images at the moment. This option is recommended for tiling window managers. This option is ignored when in fullscreen mode.

In tiling environments, this also causes the image to be centered in the window.

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.

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

The mtime sort mode sorts images by most recently modified. To sort by oldest first, reverse the filelist with --reverse.

Start the filelist at filename. Note that at the moment, filename must match an (expanded) path in the filelist. So, if the file to be matched is passed via an absolute path in the filelist, filename must be an absolute path. If the file is passed via a relative path, filename must be an identical relative path. This is a known issue. See also Usage Examples.

Load options from config file with name theme - see Themes Config Syntax for more info. Note that commandline options always override theme options. The theme can also be set via the program name (e.g. with symlinks), so by default feh will look for a “feh” theme.

Same as Index mode, but the thumbnails are clickable image launchers. Note that --fullscreen and --scale-down do not affect the thumbnail window. They do, however, work for image windows launched from thumbnail mode. Also supports Montage Mode Options.

Override feh's idea of the active Xinerama screen. May be useful in certain circumstances where the window manager places the feh window on Xinerama screen A while feh assumes that it will be placed on screen B.

In background setting mode: When used with any option other than --bg-tile: Only set wallpaper on screen. All other screens will be filled black/white. This is most useful in a Xinerama configuration with overlapping screens. For instance, assume you have two overlapping displays (index 0 and 1), where index 0 is smaller. To center a background on the display with index 0 and fill the extra space on index 1 black/white, use “--xinerama-index 0” when setting the wallpaper.

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. Specifying max is like setting --auto-zoom, using fill makes feh zoom the image like the --bg-fill mode.

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.

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-widthand--thumb-height. This will prevent any empty space in the final montage.

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 thumbnail size. Aspect ratio will be maintained unless --ignore-aspect is specified.

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.

feh can also be used as a background setter. Unless you pass the --no-fehbg option, it will write a script to set the current background to ~/.fehbg. So to have your background restored every time you start X, you can add “sh ~/.fehbg &” to your X startup script (such as ~/.xinitrc). As of feh 2.13, this script is executable, so “~/.fehbg &” will work as well.

For the --bg-center and --bg-max options, you can use the --geometry option to specify an offset from one side of the screen instead of centering the image. Positive values will offset from the left/top side, negative values from the bottom/right. +0 and -0 are both valid and distinct values.

Note that all options except --bg-tile support Xinerama. For instance, if you have multiple screens connected and use e.g. --bg-center, feh will center or appropriately offset the image on each screen. You may even specify more than one file, in that case, the first file is set on screen 0, the second on screen 1, and so on.

Use --no-xinerama to treat the whole X display as one screen when setting wallpapers. You may also use --xinerama-index to use feh as a background setter for a specific screen.

feh has three config files: themes for theme definitions, keys for key bindings and buttons for mouse button bindings. It will try to read them from $XDG_CONFIG_HOME/feh/, which (when XDG_CONFIG_HOME is unset) defaults to ~/.config/feh/. If the files are not found in that directory, it will also try /etc/feh/.

All config files treat lines starting with a “#” character as comments. Note that mid-line comments are not supported.

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. Note that the options are not parsed by any shell. Therefore, filename expansion (“*.jpg” and similar) is not supported. Quoting with both single and double quotes works, though.

You can 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. For the example above, this would be “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 an unfinished line.

.config/feh/keys defines key bindings. It has entries of the form “action [key1 [key2 [key3]]]”.

Each key is an X11 keysym name as shown by xev(1), like “Delete”. It may optionally start with modifiers for things like Control, in which case key looks like mod-keysym (for example “C-Delete” for Ctrl+Delete or “C-1-Delete” for Ctrl+Alt+Delete)

Available modifiers are Cfor Control, Sfor Shift and1, 4for Mod1 and Mod4. To match an uppercase letter like “S” instead of “s”, the Shift modifier is not required.

Specifying an action without any keys unbinds it (i.e. the default bindings are removed).

Note: Do not use the same keybinding for multiple actions. When binding an action to a new key (or mouse button), make sure to unbind it from its previous action, if present. feh does not check for conflicting bindings, so their behaviour is undefined.

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

Show menu. Use the arrow keys and return to select items, ⟨escape⟩ to close the menu.

n, ⟨Space⟩, ⟨Right⟩ [next_img]

Show next image. Selects the next image in thumbnail mode.

o [toggle_pointer]

Toggle pointer visibility

p, ⟨Backspace⟩, ⟨Left⟩ [prev_img]

Show previous image. Selects the previous image in thumbnail mode.

q, ⟨Escape⟩ [quit]

Quit feh

r [reload_image]

Reload current image. Useful for webcams

s [save_image]

Save the current image as “feh_PID_ID_FILENAME”

v [toggle_fullscreen]

Toggle fullscreen

w [size_to_image]

Change window size to fit current image size (plus/minus zoom, if set). In scale-down and fixed-geometry mode, this also updates the window size limits.

x [close]

Close current window

z [jump_random]

Jump to a random position in the current filelist

[, ] [prev_dir, next_dir]

Jump to the first image of the previous or next sequence of images sharing a directory name in the current filelist. Use --sort dirname if you would like to ensure that all images in a directory are grouped together.

<, > [orient_3, orient_1]

In place editing - rotate the image 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. Note: feh assumes that this feature is used to normalize image orientation. For JPEG images, it will unconditionally set the EXIF orientation tag to 1 (“0,0 is top left”) after every rotation. See jpegexiforient(1) for details on how to change this flag.

.config/feh/buttons. This works like the keys config file: the entries are of the form “action [binding]”.

Each binding is a button number. It may optionally start with modifiers for things like Control, in which case binding looks like mod-button (for example C-1 for Ctrl + Left button).

Note: Do not use the same button for multiple actions. feh does not check for conflicting bindings, so their behaviour is undefined. Either unbind the unwanted action, or bind it to another unused button. The order in which you bind / unbind does not matter, though.

In an image window, the following buttons may be used (The strings in [square brackets] are the config action names). Additionally, all actions specified in the Keys section can also be bound to a button.

Default Bindings: When viewing an image, mouse button 1 pans the image (moves it around) or, when only clicked, moves to the next image (slideshow mode only). Quick drags with less than 2px of movement per axis will be treated as clicks to aid graphics tablet users. Mouse 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.

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

On systems with Imlib2 >= 1.4.7 and giflib >= 5.1.2, feh may be unable to load gif images. For affected mips, mipsel and arm devices, gif support is completely broken, while on x86 / x86_64 gifs can usually only be loaded if they are the first image in the filelist. This appears to be an Imlib2 and/or giflib bug introduced in giflib 5.1.2. See ⟨https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813729⟩ for details. Workaround: Use --magick-timeout 5 (or some other positive value) to load gifs with imagemagick instead, or downgrade giflib to 5.1.1.

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

--scale-down does not take window decorations into account and may therefore make the window slightly too large.

If you find a bug, please report it to ⟨derf+feh@finalrewind.org⟩ or via ⟨http://github.com/derf/feh/issues⟩. You are also welcome to direct any feh-related comments/questions/... to #feh on irc.oftc.net.

Please include the feh version ⟨the output of “feh --version”⟩, steps to reproduce the bug and, if necessary, images to reproduce it.

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.