Swayimg uses a Lua script for configuration. The program searches for the configuration file in the following locations, in order of priority:
$XDG_CONFIG_HOME/swayimg/init.lua$HOME/.config/swayimg/init.lua$XDG_CONFIG_DIRS/swayimg/init.lua/etc/xdg/swayimg/init.lua
After installation, you can use /usr/share/swayimg/swayimg.lua as a source file for your LSP server to get autocompletion and descriptions of the available Lua bindings.
-- Example init.lua
swayimg.text.size = 32
swayimg.text.color = 0xffff0000
swayimg.viewer.default_scale = "fill"
swayimg.gallery.on_key("Delete", function()
local image = swayimg.gallery.get_image()
os.remove(image.path)
end)