LinuxCommandLibrary

feh

Display images

TLDR

View images locally or using a URL

$ feh [path/to/images]
copy

View images recursively
$ feh --recursive [path/to/images]
copy

View images without window borders
$ feh --borderless [path/to/images]
copy

Set the behavior when reaching the beginning or end of the image list
$ feh --on-last-slide [hold|quit|resume] [path/to/images]
copy

Use a specific slideshow cycle delay
$ feh --slideshow-delay [seconds] [path/to/images]
copy

Use a specific wallpaper mode (centered, filled, maximized, scaled or tiled)
$ feh --bg-[center|fill|max|scale|tile] [path/to/image]
copy

Create a montage of all images within a directory, outputting as a new image
$ feh --montage --thumb-height [150] --thumb-width [150] --index-info "[%nn%wx%h]" --output [path/to/montage_image.png]
copy

SYNOPSIS

feh [options] [files/directories...]

PARAMETERS

--recursive, -r
    Recursively searches subdirectories for images to display.

--fullscreen, -F
    Starts feh in fullscreen mode, occupying the entire screen without window decorations.

--geometry WxH+X+Y, -g WxH+X+Y
    Sets the initial window size and position. For example, 800x600+100+50 sets a 800x600 window at position (100,50).

--zoom value, -Z value
    Controls image zoom level. Can be fit (to screen), fill (screen, possibly cropping), a specific percentage (e.g., 150), or max (original size).

--hide-pointer, -B
    Hides the mouse pointer while feh's window is active.

--slideshow-delay seconds, -S seconds
    Sets the delay in seconds between images during a slideshow. A value of 0 waits for a keypress.

--preload, -P
    Preloads all specified images into memory, allowing for faster navigation and slideshows.

--thumbnails, -t
    Opens a separate window displaying image thumbnails for easy navigation and selection.

--bg-fill
    Scales the image to fill the entire screen, maintaining aspect ratio and cropping if necessary. Commonly used for setting desktop wallpapers.

--bg-max
    Scales the image to fit the screen while maintaining aspect ratio, without cropping. Pads with black if the image aspect ratio doesn't match the screen.

--bg-tile
    Tiles the image across the screen, repeating it if the image is smaller than the display area. Useful for small patterns.

--draw-filename
    Draws the filename at the bottom left of the image while viewing.

--randomize
    Randomizes the order in which images are displayed or processed from the given list.

DESCRIPTION

feh is a fast, lightweight, and highly customizable image viewer primarily designed for X11 environments. Unlike larger graphical applications, feh focuses on minimalism, speed, and scriptability, making it a popular choice for users of tiling window managers and minimalist desktop setups. It can display single images, browse directories of images, create thumbnail previews, and act as an efficient slideshow viewer. A key feature is its ability to set desktop wallpapers, offering various modes like tiling, filling, and scaling. While it provides basic image manipulation capabilities such as zooming, panning, and rotation, its strength lies in quick viewing and batch operations. feh supports a wide range of image formats, relying on underlying libraries like ImageMagick or libjpeg/libpng. Its command-line interface allows for powerful automation and integration into shell scripts, making it versatile for both interactive use and programmatic tasks.

CAVEATS

feh is primarily an X11-based application and may not function without an active X server.
While robust, it lacks advanced image editing features found in full-fledged image manipulation programs.
Performance with extremely large images or very high quantities of images can be limited by system resources.

INTERACTIVE CONTROLS

feh offers various interactive keyboard and mouse controls for navigation and basic manipulation. Common keys include:
Arrow keys or Space/Backspace for navigating between images.
+ and - for zooming in and out.
r and l for rotating the image right and left.
f for toggling fullscreen.
d for deleting the current image.
q or Esc to quit.
Right-clicking opens a context menu for more options.

WALLPAPER SETTING

One of feh's most common and widely used features is its ability to set the desktop background (wallpaper). This is achieved using the --bg-fill, --bg-scale, --bg-tile, --bg-center, or --bg-max options, followed by the path to an image file. For instance, feh --bg-fill /path/to/my/wallpaper.jpg will set the specified image as the desktop background, filling the screen.

HISTORY

Developed by Michael Stapelberg and others, feh emerged as a lightweight alternative to more resource-intensive image viewers in the early 2000s. It was designed with simplicity, speed, and scriptability in mind, making it a natural fit for minimalist desktop environments and tiling window managers like i3, Openbox, and dwm. Its focus on command-line usability and efficient resource management quickly established it as a popular choice among Linux users seeking a fast image display tool.

SEE ALSO

eog(1), sxiv(1), display(1), xdg-open(1), xsetroot(1)

Copied to clipboard