1 2 3 4 5 6 7 8 9
#!/bin/sh BACKS="/usr/share/backgrounds" if [ -n "$WAYLAND_DISPLAY" ]; then swaymsg output '*' background "$(find "$BACKS" -type f | shuf -n 1)" fill else find "/run/user/$(id -u)/" -name "sway-ipc*" \ -exec swaymsg -s {} "exec $0" + fi