#!/bin/sh
background="$(find /usr/share/backgrounds -type f | shuf -n 1)"

if [ -n "$WAYLAND_DISPLAY" ]; then
	swaymsg output '*' background "$background" fill
else
	find "/run/user/$(id -u)/" -name "sway-ipc*" \
		-exec swaymsg -s "{}" output '*' background "$background" fill ";"
fi