SWAYIMGRC(5) Swayimg configuration SWAYIMGRC(5) NAME swayimgrc - configuration file for the Swayimg viewer SYNOPSIS The Swayimg configuration file is a text-based INI file used to override the default settings. LOCATION Swayimg searches for a config file in the following locations, in this order: - $XDG_CONFIG_HOME/swayimg/config - $HOME/.config/swayimg/config - $XDG_CONFIG_DIRS/swayimg/config - /etc/xdg/swayimg/config DESCRIPTION The structure of the INI file consists of key-value pairs for properties and sections that organize properties. The basic element contained in the INI file is the key or property. Every key has a name and a value, delimited by an equals sign (=). The name appears to the left of the equals sign. The value can contain any characters. Keys are grouped into named sections. The section name appears on a line by itself, in square brackets ([ and ]). All keys after the section declaration are associated with that section. The number sign (#) at the beginning of the line indicates a comment. Empty lines and comments are ignored. Any option can be overridden using the --config argument in the command line, for instance: `swayimg --config="general.scale=real"`. SECTIONS General The general configuration is stored in the section [general]. scale = MODE Set the initial image scale, valid modes are: 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%). fullscreen = [yes|no] Start in full screen mode, no by default. antialiasing = [yes|no] Enable or disable antialising (better quality, but slow rendering), no by default. transparency = [MODE|#COLOR] Set background for transparent images: none: fully transparent, window color will be use; grid: draw chessboard (default); #COLOR: solid RGB color in hex format, e.g `#102030`. position = [MODE|COORDINATES] Set initial position of the window (Sway only): parent: set position from parent (currently active) window (default); X,Y: absolute coordinates of the top left corner. size = [MODE|SIZE] Set initial size of the window: parent: set size from parent (currently active) window (Sway only, default); image: set size from the first loaded image; WIDTH,HEIGHT: absolute size of the window in pixels. background = [MODE|#COLOR] Set window background: none: transparent window (default); #COLOR: solid RGB color in hex format, e.g `#102030`. slideshow = [yes|no] Run slideshow at startup, no by default. slideshow_time = SECONDS Set slideshow image duration in seconds, default is 3. app_id = NAME Set a constant window class/app_id. Setting this may break the window layout. Image list The image list configuration is stored in the section [list]. order = ORDER Set order of the image list: none: unsorted, order is system depended; alpha: sorted alphabetically (default); random: randomize list. loop = [yes|no] Looping file list mode, yes by default. recursive = [yes|no] Read directories recursively, no by default. all = [yes|no] Open all files in the same directory, yes by default. Font The font configuration is stored in the section [font]. name = NAME Set the font name used for text, default is monospace. size = SIZE Set the font size (in pt), default is 14. color = #COLOR Set text color in RGB hex format, default is #cccccc. shadow = [none|COLOR] Draw text shadow with specified color, default is #000000. Text info The section [info] describes how to display image meta data (file name, size, EXIF etc). Two modes are supported, each of them can have their own display scheme. mode = MODE Set startup mode: full: show all info (default); brief: show brief info; off: don't display any text. full.topleft = LIST Set display scheme for the full mode, top left corner of the window. LIST is a comma delimited list of the following lines: name: file name of the current image; path: full path to the current image; filesize: file size in human readable format; format: image format description; imagesize: image dimensions in pixels; exif: EXIF data; frame: current/total frame index; index: current/total file index; scale: current scale in percent; status: status message; none: empty field (ignored). full.topright: full mode, top right corner of the window; full.bottomleft: full mode, bottom left corner of the window; full.bottomright: full mode, bottom right corner of the window; brief.topleft: brief mode, top right corner of the window; brief.topright: brief mode, top right corner of the window; brief.bottomleft: brief mode, bottom left corner of the window; brief.bottomright: brief mode, bottom right corner of the window. Key bindings The key bindings are described in the [keys] section. Each line associates a key with some action and optional parameters. The key name can be obtained with the xkbcli tool: `xkbcli interactive- wayland`. One or more key modifiers (Ctrl, Alt, Shift) can be specified in the key name. Valid actions: none: can be used for removing built-in action; help: show/hide help; first_file: jump to the first file; last_file: jump to the last file; prev_dir: jump to previous directory; next_dir: jump to next directory; prev_file: jump to previous file; next_file: jump to next file; prev_frame: show previous frame; next_frame: show next frame; animation: start/stop animation; slideshow: start/stop slideshow; fullscreen: switch full screen mode; step_left [PERCENT]: move viewport left, default is 10%; step_right [PERCENT]: move viewport right, default is 10%; step_up [PERCENT]: move viewport up, default is 10%; step_down [PERCENT]: move viewport down, default is 10%; zoom [SCALE]: zoom in/out/fix, SCALE is one of optimal, width, height, fit, fill, real, or percent, e.g. +10; rotate_left: rotate image anticlockwise; rotate_right: rotate image clockwise; flip_vertical: flip image vertically; flip_horizontal: flip image horizontally; reload: reset cache and reload current image; antialiasing: switch antialiasing (bicubic interpolation); info [MODE]: switch text info mode or set specified one (off/brief/full); exec COMMAND: execute an external command, use % to substitute the path to the current image, %% to escape %; exit: exit the application. Mouse/touchpad The mouse configuration is stored in the section [mouse]. Same format as in [keys]. Valid keys: ScrollUp: mouse wheel up or touchpad scroll up; ScrollDown: mouse wheel down or touchpad scroll down; ScrollLeft: touchpad scroll left; ScrollRight: touchpad scroll right. EXAMPLES # comment [general] window = #112233 [list] order = random [font] size = 16 [keys] Delete = exec rm "%" Ctrl+Alt+e = exec echo "%" > mylist.txt See `/usr/share/swayimg/swayimgrc` for full example. SEE ALSO swayimg(1) BUGS For suggestions, comments, bug reports etc. visit the project homepage . swayimg 2022-02-09 SWAYIMGRC(5)