Scroll to navigation

SWAYIMG(1) Swayimg manual SWAYIMG(1)

NAME

swayimg - image viewer for Wayland display servers

SYNOPSIS

swayimg [OPTIONS]... [FILE]...

DESCRIPTION

If no input files or directories are specified, the viewer will try to read all files in the current directory.

Use '-' as FILE to read image data from stdin.

Use prefix exec:// to get image data from stdout printed by external command.

OPTIONS

-h, --help

Display help message and exit.

-v, --version

Display version information and list of supported image formats.

-g, --gallery

Start in gallery mode.

-l, --slideshow

Run slideshow on startup.

-F, --from-file

Interpret FILE as text list of image files.

-r, --recursive

Read directories recursively.

-o, --order=ORDER

Set order of the image list:
  • none: unsorted;
  • alpha: sorted alphabetically;
  • numeric: sorted numerically;
  • mtime: sorted by file modification time;
  • size: sorted by file size;
  • random: randomize list.

-s, --scale=MODE

Set image scale:
  • optimal: 100% or less to fit to window (default);
  • width: fit image width to window width;
  • height: fit image height to window height;
  • fit: fit to window;
  • fill: crop image to fill the window;
  • real: real size (100%);
  • keep: keep the same scale as for previously viewed image.

-f, --fullscreen

Start in full screen mode.

-p, --position=auto|X,Y

Set window position, this option valid only in Sway WM:
  • auto: let the window manager control the window position (default);
  • X,Y: absolute coordinates of the top left corner, e.g. 100,200.

-w, --size=fullscreen|image|W,H

Set window size:
  • fullscreen: use full screen mode;
  • image: set size from the first frame of the first image;
  • W,H: absolute size of the window in pixels, default is 1280,720.

-a, --class=NAME

Set window class/app_id.

-i, --ipc=FILE

Start IPC server based on UNIX sockets. FILE must point to the UNIX socket file to create. The IPC protocol is a simple text-based one-way protocol that allows clients to submit actions for execution. For a list of actions and their parameters, see swayimgrc(5).

-c, --config=SECTION.KEY=VALUE

Override configuration parameter, see swayimgrc(5) for a list of sections and their parameters.

-C, --config-file=FILE

Load configuration from specified FILE.

SWAY/HYPRLAND INTEGRATION

Sway/Hyprland integration mode is automatically enabled if IPC for these compositors is present in the system. This mode provides some features such as setting the window position and getting the workspace layout. By default, the application creates an "overlay" above the currently active window, which gives the illusion that the image is opened directly inside the terminal window.

ENVIRONMENT

SWAYSOCK

Path to the socket file used for Sway IPC.

HYPRLAND_INSTANCE_SIGNATURE, XDG_RUNTIME_DIR

Path to the socket file used for Hyprland IPC.

XDG_CONFIG_HOME, XDG_CONFIG_DIRS, HOME

Prefix of the path to the application config file, see swayimgrc(5) for details.

XDG_CACHE_HOME, HOME

Prefix for the path used as persistent storage for thumbnails.

SHELL

Shell for executing an external command and loading an image from stdout.

SIGNALS

SIGUSR1, SIGUSR2

Perform the actions specified in the config file.

EXIT STATUS

The exit status is 0 if the program completed successfully and 1 if an error occurred.

EXAMPLES

View multiple files:

swayimg photo.jpg logo.png

Start slideshow for all files (recursively) in the current directory in random order:

swayimg --slideshow --recursive --order=random

View using pipes:

Loading stdout from external commands:

View all images from the current directory in gallery mode:

swayimg --gallery

SEE ALSO

swayimgrc(5)

BUGS

For suggestions, comments, bug reports, etc. visit the project homepage https://github.com/artemsen/swayimg.

2025-06-29 swayimg