swayimg - Man Page
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.
- -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.
- -l, --slideshow
Run slideshow on startup.
- -f, --fullscreen
Start in full screen mode.
- -p, --position=parent|X,Y
Set window position, this option valid only in Sway WM:
- parent: set position from parent (currently active) window;
- X,Y: absolute coordinates of the top left corner, e.g. 100,200.
- -w, --size=fullscreen|parent|image|W,H
Set window size:
- fullscreen: use full screen mode;
- parent: [Only in Sway WM] set size from parent (currently active) window;
- image: set size from the first loaded image;
- W,H: absolute size of the window in pixels, e.g. 320,240.
- -a, --class=NAME
Set window class/app_id.
- -c, --config=SECTION.KEY=VALUE
Override configuration parameter, see swayimgrc(5) for a list of sections and their parameters.
Sway Mode
The Sway compatibility mode is automatically enabled if the environment variable SWAYSOCK points to a valid Sway IPC socket file. 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. Unset it or set it to /dev/null to disable integration with Sway WM.
- 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:
wget -qO- https://www.kernel.org/theme/images/logos/tux.png | swayimg -
Loading stdout from external commands:
swayimg "exec://wget -qO- https://www.kernel.org/theme/images/logos/tux.png" \ "exec://curl -so- https://www.kernel.org/theme/images/logos/tux.png"
View all images from the current directory in gallery mode:
swayimg --gallery
See Also
swayimgrc(1)
Bugs
For suggestions, comments, bug reports, etc. visit the project homepage https://github.com/artemsen/swayimg.