Feh

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.

Installation

USE flags

USE flags for media-gfx/feh

Emerge

Install media-gfx/feh:

root #emerge --ask media-gfx/feh

Usage

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
CODE
*/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.