Home

Awesome

feh - Image Viewer and Cataloguer

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, feh displays all files in the current directory.

This README focuses on installation and contribution instructions. See the feh homepage and the feh(1) manual for usage instructions.

Dependencies

Only when building with exif=1:

Only when building with magic=1:

Build Process

feh has been packaged for a variety of distributions, including Arch Linux, Debian, FreeBSD, and Ubuntu. You can configure, compile and install a custom version as follows.

Configuration

feh's build process uses make flags to enable/disable optional features and fine-tune the build and installation process. It uses (hopefully) reasonable defaults, so you can skip this section if you like.

Make flags can be passed as make arguments or set as environment variables, like so:

$ make flag=bool
$ make install flag=bool

or

$ export flag=bool
$ make && make install

The following flags are respected by the makefile. A default value of 1 indicates that the corresponding feature is enabled by default.

FlagDefault valueDescription
app0install icons to /usr/share, regardless of DESTDIR and PREFIX, and call gtk-update-icon-cache afterwards
curl1use libcurl to view https:// and similar images
debug0debug build, enables --debug
exif0Builtin EXIF tag display support
help0include help text (refers to the manpage otherwise)
inotify0enable inotify, needed for --auto-reload
stat640Support CIFS shares from 64bit hosts on 32bit machines
magic0Use libmagic to filter unsupported file formats
mkstemps1Whether your libc provides mkstemps(). If set to 0, feh will be unable to load gif images via libcurl
verscmp1Whether your libc provides strvercmp(). If set to 0, feh will use an internal implementation.
xinerama1Support Xinerama/XRandR multiscreen setups

For example, make xinerama=0 debug=1 will disable Xinerama support and produce a debug build; libcurl and natural sorting support will remain enabled.

Additionally, it supports the standard variables CFLAGS, LDLIBS, PREFIX, and DESTDIR.

PREFIX (default: /usr/local) controls where the application and its data files will be installed. It must be set both during make and make install.

DESTDIR (default: empty) sets the installation root during "make install". It is mostly useful for package maintainers.

Note: Defaults are specified in config.mk. It is designed so that in most cases, you can set environment variables instead of editing it. E.g.:

$ CFLAGS='-g -Os' make
$ export DESTDIR=/tmp/feh PREFIX=/usr
$ make && make install

Builtin EXIF support is maintained by Dennis Real, here.

Installation

Add your own make flags to the following examples as needed.

For end users:

$ make
$ sudo make install app=1

For package maintainers and users who do not want feh to install its icons into /usr/share:

$ make
$ sudo make install

Explanation: feh ships some icons and an X11 desktop entry, which allow it to be used from file managers, desktop menus and similar. However, installing icons to /usr/local/share/... does not seem to work reliably. Because of this, when using "make install app=1", feh will install its icons to /usr/share/..., even though they technically belong into /usr/local.

ZSH completion for feh is also available.

Testing (non-X11)

The non-X11 parts of feh can be automatically tested by running

$ make test

This requires perl >= 5.10 and the perl module Test::Command. Tests are non-interactive and do not require a running X11, so they can safely be run on a headless buildserver.

Contributing

Bugfixes are always welcome, just open a pull request :)

Before proposing a new feature, please consider the scope of feh: It is an image viewer and cataloguer, not an image editor or similar. Also, its option list is already pretty long. Please discuss your ideas in a feature request before opening a pull request in this case. Also, keep in mind that feh is developed as a hobby project and that there is absolutely no obligation for anyone to implement requested features or review merge requests.

Please keep in mind that feh's options, key bindings and format specifiers are documented in two different places: The manual (man/feh.pre) and the help text (src/help.raw). Although the help is not compiled in by default, it should be kept up-to-date. On space-constrained embedded systems, it may be more useful than the (significantly larger) man page.