LinuxCommandLibrary

feh

Display images

TLDR

View images locally or using a URL

$ feh [path/to/images]
copy

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

View images and display the file name at the top-left of the images
$ feh [[-d|--draw-filename]] [path/to/images]
copy

View images without window borders
$ feh [[-x|--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 [[-D|--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 [[-m|--montage]] [[-E|--thumb-height]] [150] [[-y|--thumb-width]] [150] --index-info "[%nn%wx%h]" [[-o|--output]] [path/to/montage_image.png]
copy

SYNOPSIS

feh [--no-fehbg] [options] [FILE|DIRECTORY]...

PARAMETERS

-F, --full-screen
    Display images in full-screen mode

--bg-file FILE
    Set desktop background from FILE (scale to fit)

--bg-fill
    Stretch image to fill entire background

--bg-max
    Resize to max screen dimension, center remainder

--bg-scale
    Scale image proportionally to fill screen

--bg-tile
    Tile image across desktop

--bg-center, --bg-centre
    Center image without scaling

-r, --recursive
    Recursively scan directories for images

--random
    Shuffle image order

--slideshow-delay DELAY
    Pause DELAY seconds between slideshow images (default 10)

--cycle-once
    Exit after one slideshow cycle

--start-random
    Begin slideshow at random image

-l, --list
    List image filenames instead of displaying

--montage WIDTH/HEIGHT
    Create montage of thumbnails

--font, -f FONT
    Set font for captions/titlebar

--info SCRIPT
    Run SCRIPT for image info overlay

-A, --action ACTION
    Execute shell ACTION on each image

--scale-down
    Downscale images larger than window

--zoom MAX|FIT
    Set zoom mode: max or window fit

--filelist FILE
    Read image list from FILE

--title-title FORMAT
    Customize titlebar text

--dither
    Apply dithering for better color rendering

--reload SECONDS
    Auto-reload image every SECONDS

DESCRIPTION

Feh is a versatile, fast image viewer for the X Window System, emphasizing minimal dependencies and command-line control. Developed in C, it supports common formats like JPEG, PNG, GIF, BMP, TIFF, and more via optional libraries.

Core capabilities include single-file viewing, directory browsing with recursion, slideshows, thumbnail generation, and montage creation. It shines in desktop integration: set wallpapers with scaling, tiling, filling, or centering across all screens or workspaces.

Customization is extensive via 100+ options, editable key bindings (e.g., arrow keys navigate, space pauses slideshow), and info scripts for metadata overlays. List mode outputs image paths; action mode runs scripts per image. No desktop environment required, ideal for tiling window managers like i3.

Feh avoids bloat, loads quickly, and handles large images efficiently with dithering and scaling options. Perfect for automation in scripts or quick keyboard-driven sessions.

CAVEATS

X11-only (XWayland on Wayland); requires external libs for full format support (e.g., libjpeg); no native multi-monitor gamma correction; keyboard-focused, mouse support limited.

KEY BINDINGS

Arrow keys: navigate images.
Space/Enter: next image (slideshow).
'p': pause.
Backspace: previous.
'q'/Esc: quit.
'+/-/=': zoom in/out/reset.
Customizable in ~/.config/feh/keys or --keymap.

EXAMPLES

feh --bg-scale image.jpg # Set scaled wallpaper
feh -r --random ~/Pictures # Recursive random slideshow
feh --montage 4/3 --thumb 128 *.jpg # 4x3 thumbnail grid
feh --list -r /path > imagelist.txt # Generate image list

DESKTOP INTEGRATION

Run feh --bg-file image.jpg to set wallpaper; persists via ~/.fehbg (auto-run on login). Supports multihead with --bg-file on specific outputs via xrandr names.

HISTORY

Created by Thomas Wagner in 1998 as a simple viewer; first public release ~2000. Maintained actively; version 3.0 (2015) added multi-monitor support; latest 3.10.1 (2023) improves Wayland compatibility via XWayland and font rendering.

SEE ALSO

qiv(1), display(1), eog(1), gthumb(1), xli(1), xloadimage(1)

Copied to clipboard