From Gentoo Wiki
Jump to:navigation Jump to:search

feh is an open-source image viewer that is mainly aimed at command-line users. It can be used to view images on disk or, more often, for setting the desktop background for tiling window managers like i3. It has several command line options to change the behavior for either of these uses, mostly entered around how to resize the image for the view.


USE flags

USE flags for media-gfx/feh A fast, lightweight imageviewer using imlib2

curl Add support for client-side URL transfer library
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
exif Add support for reading EXIF headers from JPEG and TIFF images
inotify Enable inotify filesystem monitoring support
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
xinerama Add support for querying multi-monitor screen geometry through the Xinerama API


Install media-gfx/feh:

root #emerge --ask media-gfx/feh


Setting backgrounds

To use it to set one's desktop background to a scaled version of a wallpaper:

user $feh --bg-scale /path/to/wallpaper

where /path/to/wallpaper is the path to the wallpaper one wishes to use as desktop background. Likewise to set the desktop background to a tiled version of the wallpaper:

user $feh --bg-tile /path/to/wallpaper

Adding these commands to ~/.xsession is an easy way to have the wallpaper set when X is started. Alternatively cron can be used to change the background in a time interval:

user $crontab -e
*/5 *  *  * * DISPLAY=":0.0" feh --randomize --bg-fill /path/to/wallpaper_library

This will run feh every 5 minutes, and every time randomly chooses a picture from the directory /path/to/wallpaper_library. The environment variable DISPLAY must be set inside of cron because cron was started before X. For more help with automated tasks on intervals, see the page for cron.

Viewing images

feh can also be used as a standalone image viewer. feh can accept a single image, a number of images, or a directory as input.

user $feh /path/to/image
user $feh /path/to/directory
Control Action
Zoom In
Zoom Out
Previous Image
Next Image
Left Mouse Drag Pans the Image
Right Mouse Click Secondary Menu
+ Zoom In
- Zoom Out
Scroll Up Previous Picture
Scroll Down Next Picture

For further details on its usage see The ArchWiki's article on feh.

See also

  • Imv — a free and open-source simple image viewer for X11/Wayland.