.TH "SWAYIMG" "1" "2026-03-08" "swayimg" "Swayimg manual" .PP .SH NAME .PP \fBswayimg\fR - image viewer for Wayland/DRM with Lua scripting support .PP .SH SYNOPSIS .PP \fBswayimg\fR [\fIOPTION\fR]... [\fIFILE\fR]... .PP If no input files or directories are specified, the viewer will try to read all files in the current directory. .PP Use \fB-\fR as \fIFILE\fR to read image data from stdin. .PP Use prefix \fBexec://\fR to get image data from stdout printed by external command. .PP .SH DESCRIPTION .PP Swayimg is a lightweight Wayland-native image viewer optimized for the Sway and Hyprland window managers, featuring an overlay mode that simulates terminal image display. The application supports slideshow and gallery modes, reads from stdin and external commands, and is highly customizable via Lua scripting. .PP .SH OPTIONS .PP \fB-h, --help\fR .RS 4 Display help message and exit. .RE .PP \fB-V, --version\fR .RS 4 Display version information and list of supported image formats. .RE .PP \fB-v, --viewer\fR .RS 4 Force start in viewer mode. .RE .PP \fB-g, --gallery\fR .RS 4 Force start in gallery mode. .RE .PP \fB-s, --slideshow\fR .RS 4 Force start in slideshow mode. .RE .PP \fB-f, --from-file\fR=\fIFILE\fR .RS 4 Load file list from text \fIFILE\fR. .RE .PP \fB-P, --position\fR=\fIX,Y\fR .RS 4 Set initial position of the window (Sway/Hyperland only). .RE .PP \fB-S, --size\fR=\fIW,H\fR .RS 4 Set initial size of the window. .RE .PP \fB-F, --fullscreen\fR .RS 4 Start in full screen mode. .RE .PP \fB-c, --config\fR=\fIFILE\fR .RS 4 Load the specified Lua \fIFILE\fR instead of default one. .RE .PP \fB-e, --execute\fR=\fILUA\fR .RS 4 Execute the specified Lua script after loading the configuration. .RE .PP \fB--appid\fR=\fIID\fR .RS 4 Set application Id. .RE .PP \fB--verbose\fR .RS 4 Enable verbose output. .RE .PP .SH KEYS .PP .SS Viewer and Slideshow .PP .PD 0 .IP \(bu 4 \fBEsc\fR: Exit from application .IP \(bu 4 \fBEnter\fR: Switch to gallery mode .IP \(bu 4 \fBs\fR: Enable/disable to slideshow mode .IP \(bu 4 \fBInsert\fR: Mark/unmark currently displayed image .IP \(bu 4 \fBDelete\fR: Skip image (remove from the image list) .IP \(bu 4 \fBf\fR: Enable/disable full screen mode .IP \(bu 4 \fBa\fR: Enable/disable anti-aliasing .IP \(bu 4 \fB]\fR: Rotate the image 90 degrees clockwise .IP \(bu 4 \fB[\fR: Rotate the image 90 degrees counterclockwise .IP \(bu 4 \fBm\fR: Flip image vertically .IP \(bu 4 \fBShift-m\fR: Flip image horizontally .IP \(bu 4 \fBt\fR: Show/hide text info layer .IP \(bu 4 \fBPgDown\fR: Show next image .IP \(bu 4 \fBPgUp\fR: Show previous image .IP \(bu 4 \fBShift-PgDown\fR: Show next frame .IP \(bu 4 \fBShift-PgUp\fR: Show previous frame .IP \(bu 4 \fB+\fR: Zoom in .IP \(bu 4 \fB-\fR: Zoom out .IP \(bu 4 \fBLeft/Right/Up/Down\fR: Move around the image .IP \(bu 4 \fBBackspace\fR: Reset scale and image position to defaults .PD .PP Mouse bindings: .PD 0 .IP \(bu 4 \fBScrollUp/ScrollDown/ScrollLeft/ScrollRight\fR: Move image .IP \(bu 4 \fBCtrl-ScrollUp\fR: Zoom in .IP \(bu 4 \fBCtrl-ScrollDown\fR: Zoom out .IP \(bu 4 \fBMouseLeft\fR: Move image (drag) .IP \(bu 4 \fBMouseRight\fR: Drag-and-drop image to external applications .PD .PP .SS Gallery .PP .PD 0 .IP \(bu 4 \fBEsc\fR: Exit from application .IP \(bu 4 \fBHome\fR: Select first thumbnail in image list .IP \(bu 4 \fBEnd\fR: Select last thumbnail in image list .IP \(bu 4 \fBLeft\fR: Select the thumbnail to the left of the current one .IP \(bu 4 \fBRight\fR: Select the thumbnail to the right of the current one .IP \(bu 4 \fBUp\fR: Select the thumbnail above the current one .IP \(bu 4 \fBDown\fR: Select the thumbnail below the current one .IP \(bu 4 \fBPgUp\fR: Select the thumbnail on the previous page .IP \(bu 4 \fBPgDown\fR: Select the thumbnail on the next page .IP \(bu 4 \fBEnter\fR: Switch to viewer mode .IP \(bu 4 \fBs\fR: Switch to slideshow mode .IP \(bu 4 \fBInsert\fR: Mark/unmark currently selected image .IP \(bu 4 \fBDelete\fR: Skip image (remove from the image list) .IP \(bu 4 \fBf\fR: Enable/disable full screen mode .IP \(bu 4 \fBa\fR: Enable/disable anti-aliasing .IP \(bu 4 \fB+\fR: Increase thumbnail size .IP \(bu 4 \fB-\fR: Decrease thumbnail size .IP \(bu 4 \fBt\fR: Show/hide text info layer .PD .PP Mouse bindings: .PD 0 .IP \(bu 4 \fBMouseLeft\fR: Open currently selected image in viewer .IP \(bu 4 \fBMouseRight\fR: Drag-and-drop image to external applications .IP \(bu 4 \fBCtrl-ScrollUp\fR: Increase thumbnail size .IP \(bu 4 \fBCtrl-ScrollDown\fR: Decrease thumbnail size .IP \(bu 4 \fBScrollUp/ScrollDown/ScrollLeft/ScrollRight\fR: Select next image .PD .PP .SH ENVIRONMENT .PP \fBSWAYSOCK\fR .RS 4 Path to the socket file used for Sway IPC. .RE .PP \fBHYPRLAND_INSTANCE_SIGNATURE\fR, \fBXDG_RUNTIME_DIR\fR .RS 4 Path to the socket file used for Hyprland IPC. .RE .PP \fBXDG_CONFIG_HOME\fR, \fBXDG_CONFIG_DIRS\fR, \fBHOME\fR .RS 4 Prefix for the path to the default application config file. .RE .PP \fBSHELL\fR .RS 4 Shell used for executing an external command and loading an image from stdout. .RE .PP .SH SIGNALS .PP \fBSIGUSR1\fR, \fBSIGUSR2\fR .RS 4 Perform the actions specified in the config file. .RE .PP .SH EXIT STATUS .PP The exit status is 0 if the program completed successfully and 1 if an error occurred. Other codes can be specified via Lua script. .PP .SH EXAMPLES .PP Viewing multiple files: .NF .RS 4 swayimg photo.jpg logo.png .RE .FI .PP Displaying an image received via a pipe: .NF .RS 4 wget -qO- https://www.kernel.org/theme/images/logos/tux.png | swayimg - .RE .FI .PP Loading stdout from external commands: .NF .RS 4 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" .RE .FI .PP .SH FILES .PP The application searches for and processes the \fBinit.lua\fR file at startup. The file is a Lua script that sets initial parameters, adds hooks and changes the behavior of the program. .PP Possible file locations: .PD 0 .IP \(bu 4 \fB$XDG_CONFIG_HOME/swayimg/init.lua\fR .IP \(bu 4 \fB$HOME/.config/swayimg/init.lua\fR .IP \(bu 4 \fB$XDG_CONFIG_DIRS/swayimg/init.lua\fR .IP \(bu 4 \fB/etc/xdg/swayimg/init.lua\fR .PD .PP .SH BUGS .PP For suggestions, comments, bug reports, etc. visit the project homepage https://github.com/artemsen/swayimg.