Scroll to navigation

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.mode=gallery"`.

SECTIONS

General

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

Mode used at startup, viewer by default.
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, e.g. 100,200.
Set initial size of the window:

fullscreen: use fullscreen mode; parent: set size from parent (currently active) window (Sway only, default); image: set size from the first loaded image; W,H: absolute size of the window in pixels.
Use window decoration (borders and title), no by default.
Set the action to be performed when the SIGUSR1 signal is triggered.
Default value is reload.
Set the action to be performed when the SIGUSR2 signal is triggered.
Default value is next_file.
Application ID used as window class name.

Viewer

Configuration is defined in the [viewer] section.

Window background color in RGB or RGBA format, default is #00000000.
Background for transparent images:
grid: draw chessboard (default);
#COLOR: solid color in RGB or RGBA, e.g "#10ff4280".
Default 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%).
Keep absolute zoom across images, no by default.
Initial image position, valid modes are:

top: move image to top and center by width; center: center by width and height (default); bottom: move to bottom and center by width; left: move to left and center by height; right: move to right and center by height; topleft: move to top and left; topright: move to top and right; bottomleft: move to bottom and left; bottomright: move to bottom and right.
Fix position of the image on the window surface, yes by default.
Scale method to use when anti-aliasing is enabled, valid choices are:

nearest: nearest-neighbor, equivalent to antialiasing = no; box: nearest-neighbor on upscale, average in a box on downscale; bilinear: bilinear; bicubic: bicubic with the Catmull-Rom spline; mks13: Magic Kernel with the 2013 Sharp approximation (default);
In general, the methods improve in quality and decrease in performance from top to bottom.
Run slideshow at startup, no by default.
Set slideshow image duration in seconds, default is 3.
Number of previously viewed images to store in cache, 1 by default.
Number of images to preload in a separate thread, 1 by default.

Configuration is defined in the [gallery] section.

Size of the thumbnail in pixels, 200 by default.
Enable/disable storing thumbnails in persistent storage, no by default.
Fill the entire tile with thumbnail, yes by default.
Max number of thumbnails in cache, 0 for unlimited, 100 by default.
Scale method to use when anti-aliasing is enabled, valid choices are:
nearest: nearest-neighbor, equivalent to antialiasing = no;
box: nearest-neighbor on upscale, average in a box on downscale;
bilinear: bilinear;
bicubic: bicubic with the Catmull-Rom spline;
mks13: Magic Kernel with the 2013 Sharp approximation (default);

In general, the methods improve in quality and decrease in performance from top to bottom.
Background color of the window, default is #00000000.
Background color of the tile, default is #202020ff.
Border color of the selected tile, default is #000000ff.
Shadow color of the selected tile, default is #000000ff.

Image list

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);
reverse: reversed alphabetically;
random: randomize list.
Looping file list mode, yes by default.
Read directories recursively, no by default.
Open all files in the directory of the specified file, no by default.

Font

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 RGBA format, default is #ccccccff.
Text background color, default is #00000000 (none).
Draw text shadow with specified color, default is #000000d0. To disable shadow use fully transparent color #00000000.

Text info: common configuration

The section [info] describes how to display image meta data (file name, size, EXIF etc).

Enable or disable info text at startup, yes by default.
Timeout of image information displayed on the screen, 0 to always show, default is 5.
Timeout of the status message displayed on the screen, default is 3.

Text info: viewer

The section [info.viewer] describes how to display image meta data (file name, size, EXIF etc) in viewer mode. Each key/value configures a set of fields and their format.

Set the display scheme for the upper left corner of the window.
Set the display scheme for the upper right corner of the window.
Set the display scheme for the lower left corner of the window.
Set the display scheme for the lower right corner of the window.

LIST can contain any number of fields separated by commas. Plus at the beginning of a field name adds the field title to the display. Available fields:

File name of the currently viewed/selected image.
Parent directory name the currently viewed/selected image.
Absolute path or special source string of the currently viewed/selected image.
File size in human readable format.
Brief image format description.
Size of the image (or its current frame) in pixels.
List of EXIF data.
Current and total number of frames.
Current and total index of image in the image list.
Current image scale in percent.
Status message.
Empty field (ignored).

The section [info.gallery] describes how to display image meta data (file name, size, EXIF etc) in gallery mode, same format as for viewer mode.

Key bindings

The key bindings are described in sections [keys.viewer] and [keys.gallery]. Each line associates a key with a list of actions and optional parameters. Actions are separated by semicolons. One or more key modifiers (Ctrl, Alt, Shift) can be specified in the key name. The key name can be obtained with the xkbcli tool: `xkbcli interactive-wayland`.

Predefined names for mouse scroll:

Viewer mode actions

EXAMPLES

# comment
[list]
order = random
[font]
size = 16
[keys]
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.

2022-02-09 swayimg