#!/bin/sh

dir="$HOME/Pictures/Wallpapers"
list=$(/usr/bin/ls "${dir}")
options=""

# Destroy running swaybg process
pkill swaybg

for i in $( wlr-randr | grep "\"*.\"" | awk '{print $1}' )
do
  choice=$(echo "${list}" | shuf -n 1)
  options="${options}--output ${i} --image ${dir}/${choice} --mode fill "
done

swaybg ${options} &
