FEH(1) | General Commands Manual | FEH(1) |
feh
— image viewer
and cataloguer
feh |
[options] [-- ]
[files | directories |
URLs ...] |
This manual documents feh
3.9.1
Compile-time switches in this build:
feh
is a light-weight, configurable and
versatile image viewer. It is aimed at command line users, but can also be
started from graphical file managers. Apart from viewing images, it can
compile text and thumbnail listings, show (un)loadable files, set X11
backgrounds, and more.
Features include filelists, various image sorting modes, custom
action scripts, and image captions. feh
can be
controlled by configurable keyboard and mouse shortcuts, terminal input and
signals. When no file arguments or filelists are specified and
--start-at
is not used, feh
displays all files in the current directory.
EXIF tags are supported either using exiv2 / exifgrep via
--info
(see the
USAGE EXAMPLES
section), or as a builtin feature by compiling
feh
with exif=1. In this build of
feh
, builtin EXIF support is available.
feh
is based on various modes, which are
selected at startup by command line options.
Slideshow mode is the default. It opens a window and displays the first image in it; the slideshow position can be advanced (or otherwise changed) using keyboard and mouse shortcuts. In slideshow mode, images can be deleted either from the filelist or from the disk, a changed filelist can also 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, size and dimensions, 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. Instead, it outputs an
ls
-style listing of the
files in the filelist, including image info such as size, number of pixels,
type, etc. There is also a Customlist mode which prints image info in a
custom format specified by a printf-like format string.
feh
can also list either all the loadable
files in a filelist or all the unloadable files. This is useful for preening
a directory.
feh
can open any format supported by
imlib2, most notably jpeg, png, pnm, tiff, and bmp. The gif format is also
supported, but only for static images. In case of animations, only the first
frame will be shown. If the convert binary (supplied by ImageMagick) is
available, it also has limited support for many other file types, such as
svg, xcf and otf. If dcraw is available, feh
also
supports RAW files provided by cameras and will display the embedded
thumbnails. Use --conversion-timeout
timeout with a non-negative value to enable support
for these formats.
(optional feature, disabled in this build)
feh
can use libmagic to only pass image files to
Imlib2. This feature is disabled in this build. When using
feh
with lots of non-image files (especially with
Imlib2 version 1.6.x or 1.7.0), this can speed up the detection of non-image
files significantly. If you think that Imlib2 can load a file which
feh
has determined to be likely not an image, set
the environment variable "FEH_SKIP_MAGIC" to pass all files
directly to Imlib2, bypassing this check. The environment variable's value
does not matter, it just needs to be set.
-A
,
--action
[flag][[title]]actionIf 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 %F ~/images/%N" *".
--action1
.. --action9
[flag][[title]]action--auto-reload
--reload=0
option.
Automatic reload is not supported in montage, index, or thumbnail mode.
--auto-rotate
Note that Imlib2 version 1.7.5+ performs auto-rotation by
itself, so this option is obsolete on systems with Imlib2 version 1.7.5
or later. feh
currently cannot detect this at
runtime.
-Z
,
--auto-zoom
-x
,
--borderless
--cache-size
size-P
,
--cache-thumbnails
-K
,
--caption-path
path--conversion-timeout
timeoutfeh
can use ImageMagick to try converting
unloadable files into a supported file format. As this can take a long
time, it is disabled by default. Set timeout to a
non-negative value to enable it. A positive value specifies after how many
seconds conversion attempts should be aborted, zero causes
feh
to try indefinitely. Negative values restore
the default by disabling conversion altogether.--class
class-L
,
--customlist
format-G
,
--draw-actions
--draw-exif
--info
with exiv2 / exifgrep.-d
,
--draw-filename
--draw-tinted
--draw-filename
et al) on a semi-transparent background to improve
their readability.--edit
-f
,
--filelist
fileIf 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 command line when
also specifying the list.
If file is "-",
feh
will read the filelist from its standard
input.
-e
,
--font
font-C
,
--fontpath
path--force-aliasing
-I
,
--fullindex
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.
-F
,
--fullscreen
--zoom
zoom 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.
When combined with --thumbnails
, this
option only affects images opened from the thumbnail overview. The
thumbnail list itself will still be windowed.
-g
,
--geometry
width
x
height |
+
x +
y |
width x
height +
x +
y--scale-down
to
scale down larger images like in fullscreen mode. Note that this option
does not enforce the window size; changing it by a tiling WM or manually
is still possible. However, auto-resize remains disabled.-Y
,
--hide-pointer
-B
,
--image-bg
stylechecks
is
not accepted and the default is black.-i
,
--index
--info
[flag]command_line--insecure
-k
,
--keep-http
feh
normally
deletes the local copies after viewing, or, if caching, on exit. This
option permanently stores them on disk, either in the directory specified
by --output-dir
, or in the current working
directory.--keep-zoom-vp
-l
,
--list
-U
,
--loadable
--max-dimension
width x
height-M
,
--menu-font
font--min-dimension
width x
height-m
,
--montage
-w
,
--multiwindow
--no-conversion-cache
feh
will only load/convert them once and re-use
the cached file on subsequent slideshow passes. This option disables the
cache. It is also disabled when --reload
is used.
Use it if you rely on frequently changing files loaded via one of these
sources. Note that it will impair performance.--no-jump-on-resort
-N
,
--no-menus
--no-screen-clip
--no-xinerama
--on-last-slide
hold
|
quit
|
resume
With hold
, feh
will stop advancing images in this case and continue displaying the
first/last image, respectively. This is intended for linear slide shows.
Behaviour is unspecified when using other navigation commands than
previous and next image.
quit
will cause
feh
to quit when trying to advance past the last
image in the slide show.
resume
is the default behaviour: On
the last (first) image, feh
will wrap around to
the first (last) image.
-j
,
--output-dir
directory--keep-http
or the save_image or save_filelist
command. By default, files are saved in the current working
directory.-p
,
--preload
-q
,
--quiet
-z
,
--randomize
-r
,
--recursive
--no-recursive
--recursive
.-R
,
--reload
intIf an image is removed, feh
will
either show the next one or quit. However, if an image still exists, but
can no longer be loaded, feh
will continue to
try loading it.
Setting this option causes inotify-based auto-reload to be disabled. Reload is not supported in montage, index, or thumbnail mode.
-n
,
--reverse
-nSwidth
.-.
,
--scale-down
In tiling environments, this also causes the image to be centered in the window.
--scroll-step
count-D
,
--slideshow-delay
floatfeh
in paused mode.-S
,
--sort
sort_typename
, filename
,
dirname
, mtime
,
width
, height
,
pixels
, size
,
format
. For sort modes other than
name
, filename
,
dirname
, or mtime
, a
preload run is necessary, causing a delay proportional to the number of
images in the list.
mtime
starts with the most recently
modified image. width
,
height
, pixels
and
size
start with the smallest. Use
--reverse
to sort by oldest or largest
first.
For name
,
filename
, and dirname
you can use --version-sort
to sort numbers
naturally, so that e.g. 10.jpg comes after 2.jpg.
-|
,
--start-at
filenamefeh
will first load all files from the directory in which
filename resides. This way, it's possible to look at
a specific image and use the next / prev keys to browse through the
directory. See USAGE EXAMPLES for
examples. If filename is a remote URL and no files
or filelists were specified, feh
will show
filename and not attempt to load additional files or
directories.
Note: If you use relative paths in your filelist,
filename should also be a relative path. If you
use absolute paths, it should also be an absolute path. If
feh
cannot find an exact match, it will compare
basenames (filenames without the directory suffix). This may lead to
mismatches if several files in your filelist have the same basename.
-T
,
--theme
themefeh
will look for a
"feh
" theme.-t
,
--thumbnails
--fullscreen
and
--scale-down
do not affect the thumbnail window.
They do, however, work for image windows launched from thumbnail mode.
Also supports INDEX
AND THUMBNAIL MODE OPTIONS as well as
MONTAGE MODE OPTIONS.-~
,
--thumb-title
string-^
,
--title
title-u
,
--unloadable
-V
,
--verbose
-v
,
--version
--version-sort
--sort name
,
--sort filename
, or --sort
dirname
: use natural sorting for file and directory names. In this
mode, filenames are sorted as an ordinary human would expect, e.g.
"2.jpg" comes before "10.jpg". Note that this option
only has an effect when a sort mode is set using
--sort
.--window-id
windowidfeh
to draw into it
or attempt to use options or keybindings which affect window attributes,
such as full-screen mode.--xinerama-index
monitorfeh
's idea of the active
Xinerama monitor. May be useful in certain circumstances where the window
manager places the feh window on Xinerama monitor A while
feh
assumes that it will be placed on monitor B.
In background setting mode: When used with any option other
than --bg-tile
: Only set wallpaper on
monitor. All other monitors will be filled
black/white. This is most useful in a Xinerama configuration with
overlapping monitors. 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.
Use xrandr --listmonitor
to determine
how Xinerama monitor IDs map to screens/monitors in your setup.
--zoom
percent |
max
|
fill
--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.--zoom-step
percentThese additional options can be used for index, montage and (partially) thumbnail mode.
-a
,
--alpha
int-b
,
--bg
file |
trans
-X
,
--ignore-aspect
--thumb-width
and
--thumb-height
. This will prevent any empty space
in the final montage.-H
,
--limit-height
pixels-W
,
--limit-width
pixelsIf both --limit-width
and --limit-height
are
specified, the montage will be exactly width
x height pixels in
dimensions.
-o
,
--output
file-O
,
--output-only
file-s
,
--stretch
--ignore-aspect
is specified.-E
,
--thumb-height
pixels-y
,
--thumb-width
pixelsIn addition to MONTAGE
MODE OPTIONS --alpha
,
--bg
, --limit-height
,
--limit-width
, --output
,
--output-only
,
--thumb-height
,
--thumb-width
, the following options can be
used.
--index-info
formatNote: 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.
-@
,
--title-font
font-J
,
--thumb-redraw
nIn many desktop environments, 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 "~/.fehbg
&" to your X startup script (such as
~/.xinitrc). Note that the commandline written to
~/.fehbg always includes the
--no-fehbg
option to ensure that it is not
inadvertently changed by differences in X11 screen layout or similar.
Note that feh
does not support setting the
wallpaper of GNOME shell desktops. In this environment, you can use
"gsettings set org.gnome.desktop.background picture-uri
file:///path" instead.
For --bg-center
,
--bg-fill
, and --bg-max
, you
can use --geometry
to specify an offset from one
side of the monitor 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 monitors connected and
use e.g. --bg-center
, feh
will center or appropriately offset the image on each monitor. You may even
specify more than one file, in that case, the first file is set on monitor
0, the second on monitor 1, and so on. Use xrandr
--listmonitor
to determine how Xinerama monitor IDs map to screens /
monitors in your setup.
Use --no-xinerama
to treat the whole X
display as one monitor when setting wallpapers. You may also use
--xinerama-index
to use feh
as a background setter for a specific monitor.
--bg-center
--image-bg
.--bg-fill
--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
--bg-fill
, but scale the image to the maximum
size that fits the screen with borders on one side. The border color can
be set using --image-bg
.--bg-scale
--bg-tile
--no-fehbg
feh
versionfeh
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. Comments at the end of a line are not supported.
.config/feh/themes allows the naming of option groups, called themes.
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 option parser does not behave like a normal shell: filename expansion and backslash escape sequences are not supported and passed to feh's option parser as-is. However, quoting of arguments is respected and can be used for arguments with whitespace. So, the sequence "--info "foo bar"" works as intended (that is, it display the string "foo bar"), whereas the option string "--info foo\ bar" will only display "foo\" and complain about the file bar not existing. Please keep this in mind when writing theme files.
An example entry is "imagemap -rVq --thumb-width 40 --thumb-height 30 --index-info '%n\n%wx%h'".
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. A single option-argument-pair must not span multiple lines. A single line must not be longer than 1023 characters, but there's no upper limit for the length of a theme.
Command line options always override theme options.
.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 C for Control, S for Shift and 1, 4 for 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.
For a list of the action names, see KEYS. Note that not all of the key names used there correspond to X11 keysyms. Most notably, page up (Prior / Page_Up), page down (Next / Page_Down) and the keypad keys (KP_*) do not.
The following actions and default key bindings can be used in an
image window. (The strings in [square brackets] are the config action
names). If feh
is running inside a terminal and its
standard input is not used for images or filelists, key input from the
terminal is also accepted. However, terminal input support is currently
limited to most alphanumeric characters (0-9 a-z A-Z and some more), arrow
keys, return and backspace. The Alt (Mod1) modifier is also supported.
--draw-actions
)--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⟩.--draw-filename
)--slideshow-delay
.--info
)feh
will keep zoom and X, Y offset when switching
images.--output-dir
, if
set, and in the current working directory otherwise.feh
--output-dir
, if set,
and in the current working directory otherwise.When --edit
is used, this also rotates
the image in the underlying file. 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.
--edit
is used, this
also flips the image in the underlying file (see above).--edit
is used, this
also flips the image in the underlying file (see above).--action
,
1 = --action1
etc.)--action
--bg-fill
The following keys bindings are used for the
feh
menu:
.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.
For the available modifiers, see KEYS CONFIGURATION SYNTAX.
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.
quit
, you can turn feh into a simple
screensaver.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.
In slideshow and multiwindow mode, feh
handles the following signals:
Here are some examples of useful option combinations. See also: ⟨https://feh.finalrewind.org/examples/⟩
When --edit
is used,
feh
needs the jpegtran
and
jpegexiforient
binaries (usually distributed in
"libjpeg-progs" or similar) for lossless JPEG rotation.
To view images from URLs such as "http://",
feh
must be compiled with libcurl support. It is
enabled in this build
Imlib2 releases prior to 1.7.4 are unable to load gif, tiff, and webp images if the filename does not end with gif, tiff, or webp, respectively. Notably, this means that feh is unable to show gif, tiff, and webp images from stdin or network URLs on systems using an Imlib2 version older than 1.7.4.
Imlib2 releases 1.7.5+ automatically rotate images based on their
EXIF tags. When combined with the --auto-rotate
option, this causes images to be rotated twice and end up in an incorrect
orientation. As a workaround, do not use
--auto-rotate
on systems with Imlib2 version 1.7.5
or later.
On systems with 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 a bug
in giflib, see
⟨https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813729⟩ for
details. Workaround: Use --conversion-timeout 5
(or
some other positive value) to load gifs with imagemagick instead, or
downgrade to giflib 5.1.1, or upgrade to giflib 5.1.4.
While loading images using libcurl, feh
will not react to key or mouse actions.
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 ⟨https://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. Note that feh
is a hobby
project, so bug reports may be addressed with significant delays.
Copyright (C) 1999, 2000 by Paul Duncan. Copyright (C) 1999, 2000 by Tom Gilbert and contributors. Copyright (C) 2010-2020 by Daniel Friesel and 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⟩
Website: https://feh.finalrewind.org
August 22, 2022 | Debian |