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.

fixed = [yes|no]
    Fix position of the image on the window surface, yes by default.

transparency = [MODE|#COLOR]
    Set background for transparent images:
    grid: draw chessboard (default);
    #COLOR: solid RGB or RGBA color in hex format, e.g "#10ff4280".
    For RGB color, the default alpha channel is FF.

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 = #COLOR
    Set window background color in RGBA format, default is #00000000.

slideshow = [yes|no]
    Run slideshow at startup, no by default.

slideshow_time = SECONDS
    Set slideshow image duration in seconds, default is 3.

gallery = [yes|no]
    Start in gallery mode, no by default.

app_id = NAME
    Set a constant window class/app_id. Setting this may break the window layout.

  Gallery
Configuration is defined in the [gallery] section.

size = PIXELS
    Max size of the thumbnail in pixels, 200 by default.

antialiasing = [yes|no]
    Use anti-aliasing for thumbnails, no by default.

window = #COLOR
    Background color of the window, default is #00000000.

background = #COLOR
    Background color of the tile, default is #202020ff.

select = #COLOR
    Set window background of the selected tile, default is #404040ff.

  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.

cache = SIZE
    Number of previously viewed images to store in cache, 1 by default.

preload = SIZE
    Number of images to preload in a separate thread, 1 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 RGBA format, default is #ccccccff.

shadow = #COLOR
    Draw text shadow with specified color, default is #000000a0. To disable shadow use fully transparent color #00000000.

  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.

timeout = SECONDS|PERCENT
    Set timeout of image information displayed on screen. Value is in seconds (e.g. `5`) or in percentage of slideshow_time (e.g. `50%`). `timeout=0` disables the timeout (info block is shown forever). If set as a percentage of the slideshow time, but slideshow is disabled, this timeout will be disabled too. Default is 0.

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 a list of actions and optional parameters. Actions are separated by semicolons. 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;

skip_file: skip the current file (remove from the image list);

animation: start/stop animation;

slideshow: start/stop slideshow;

fullscreen: switch full screen mode;

mode: switch between viewer and gallery;

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 %;

status TEXT: print message in the status field;

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 "%"; reload
    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 (https://github.com/artemsen/swayimg).