LinuxCommandLibrary

swaybg

Wayland wallpaper setter for Sway

TLDR

Set wallpaper

$ swaybg -i [wallpaper.jpg]
copy
Specific output
$ swaybg -o [HDMI-A-1] -i [wallpaper.jpg]
copy
Fill mode
$ swaybg -i [wallpaper.jpg] -m fill
copy
Tile mode
$ swaybg -i [wallpaper.jpg] -m tile
copy
Solid color
$ swaybg -c "[#1a1a2e]"
copy
Center image
$ swaybg -i [wallpaper.jpg] -m center
copy

SYNOPSIS

swaybg [-o output] [-i image] [-m mode] [-c color]

DESCRIPTION

swaybg sets desktop wallpapers for Sway and other wlroots-based Wayland compositors. It supports displaying image files with various scaling modes (stretch, fill, fit, center, tile) or setting a solid background color using hex codes.
Different wallpapers can be assigned to individual outputs by specifying the output name, enabling per-monitor backgrounds in multi-display setups. The tool runs as a persistent background process; to change the wallpaper, the running instance must be killed and a new one started with the desired settings.
Swaybg is typically launched from the Sway configuration file using an `exec` directive, ensuring the wallpaper is set automatically when the compositor starts.

PARAMETERS

-i, --image FILE

Wallpaper image.
-o, --output OUTPUT
Target output.
-m, --mode MODE
Scaling mode.
-c, --color COLOR
Background color.

MODES

stretch - Stretch to fill
fill - Fill, crop excess
fit - Fit, may letterbox
center - Center, no scaling
tile - Tile image

CAVEATS

Wayland only. Sway/wlroots compositors. One instance per wallpaper.

HISTORY

swaybg is part of the Sway project, a Wayland compositor. It provides simple background management for wlroots-based compositors.

SEE ALSO

sway(1), swaylock(1), feh(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community