SWAYIMGRC(5) Swayimg configuration SWAYIMGRC(5)

swayimgrc - configuration file for the Swayimg viewer

The Swayimg configuration file is a text-based INI file used to override the default settings.

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

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"`.

The general configuration is stored in the section [general].

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%).
Start in full screen mode, no by default.
Enable or disable antialising (better quality, but slow rendering), no by default.
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`.
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.
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.
Set window background:
none: transparent window (default);
#COLOR: solid RGB color in hex format, e.g `#102030`.
Run slideshow at startup, no by default.
Set slideshow image duration in seconds, default is 3.
Set a constant window class/app_id. Setting this may break the window layout.

The image list configuration is stored in the section [list].

Set order of the image list:
none: unsorted, order is system depended;
alpha: sorted alphabetically (default);
random: randomize list.
Looping file list mode, yes by default.
Read directories recursively, no by default.
Open all files in the same directory, yes by default.

The font configuration is stored in the section [font].

Set the font name used for text, default is monospace.
Set the font size (in pt), default is 14.
Set text color in RGB hex format, default is #cccccc.
Draw text shadow with specified color, default is #000000.

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.

Set startup mode:
full: show all info (default);
brief: show brief info;
off: don't display any text.
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.

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:

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.

# 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.

swayimg(1)

For suggestions, comments, bug reports etc. visit the project homepage.

2022-02-09 swayimg