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 queryChanges 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-1Setting 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 autoSee 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-10 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
| Command | Does |
|---|---|
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 |
clear | Clear images, fit, blur, or a combination |
query | Show the wallpaper, fit, blur, and outputs |
query --json | Same as JSON, plus dominant colors |
doctor | Check the session, config, socket, and daemon |
reload | Reread the config and repaint |
stop | Stop the daemon |
| Option | Does |
|---|---|
-o, --output <name> | Limit the command to one output |
-p, --persist | Save an img, set, or clear change |
-h, --help | Show usage |
-V, --version | Show 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
| Path | Purpose |
|---|---|
$XDG_CONFIG_HOME/sweetbg/config.toml | Config file |
$XDG_RUNTIME_DIR/sweetbg.sock | Control socket, also used for subscriptions |
The full reference is in the man pages: sweetbg(1), sweetbgd(1), and
sweetbg(5).