Sweets

Commands

Control Sweetbg from the terminal and scripts

sweetbg sends one command to the daemon and exits.

sweetbg img ~/Pictures/wall.jpg
sweetbg set fit contain
sweetbg query

Changes are temporary. Add --persist (-p) to save them to the config.

Wallpapers

# Every output
sweetbg img ~/Pictures/wall.jpg

# Random image from a folder
sweetbg img ~/Pictures/Wallpapers/

# One image per output
sweetbg img DP-1=~/left.jpg HDMI-A-1=~/right.jpg

# One output only
sweetbg img ~/Pictures/side.jpg --output DP-1

Setting an image for every output clears the per-output images.

Fit and color

sweetbg set fit cover
sweetbg set fit contain --output DP-1
sweetbg set color "#1e1e2e"
sweetbg set color auto

See fit modes for what each mode does.

Blur

Blur is off by default. Set its strength from 0 to 100:

sweetbg set blur 24 --persist
sweetbg set blur 0 --output DP-1

0 disables it. Setting blur without --output also clears runtime per-output blur overrides. See blur for how it is applied.

Clear

# Drop all images, show the background color
sweetbg clear

# Reset fit back to cover
sweetbg clear --fit

# Restore one output's default blur
sweetbg clear --blur --output DP-1

# Keep one output blank, even with a default image set
sweetbg clear --output eDP-1 --blank

--image and --fit can be combined. --blur without --output resets all blur to 0. With --persist, the saved settings are removed too.

Reference

CommandDoes
img <path>Set the wallpaper. A folder picks a random image
img <name>=<path> ...Set wallpapers per output
set fit <mode>Set the fit mode
set color <#rrggbb|auto>Set the background color
set blur <0..100>Set the blur sigma. 0 disables it
clearClear images, fit, blur, or a combination
queryShow the wallpaper, fit, blur, and outputs
query --jsonSame as JSON, plus dominant colors
doctorCheck the session, config, socket, and daemon
reloadReread the config and repaint
stopStop the daemon
OptionDoes
-o, --output <name>Limit the command to one output
-p, --persistSave an img, set, or clear change
-h, --helpShow usage
-V, --versionShow the version

Exit codes: 0 success, 1 daemon or command error, 2 invalid usage.

Theming from the wallpaper

query --json includes each output's dominant colors:

sweetbg query --json | jq -r '.outputs[0].colors[0]'

Use it to drive a color scheme from the current wallpaper.

Files

PathPurpose
$XDG_CONFIG_HOME/sweetbg/config.tomlConfig file
$XDG_RUNTIME_DIR/sweetbg.sockControl socket, also used for subscriptions

The full reference is in the man pages: sweetbg(1), sweetbgd(1), and sweetbg(5).

On this page