#!/bin/sh

dir="$HOME/Pictures/Wallpapers/"
list=$(find "$dir" -type f -or -type l \
    -name "*.png" \
    -or -name "*.jpg" \
    -or -name "*.jpeg" \
    -or -name "*.PNG" \
    -or -name "*.JPG" \
    -or -name "*.JPEG" \
    -or -name "*.gif")

for i in $(swaymsg -t get_outputs | grep "name" | awk '{print $2}' | sed s/\",*//g)
do
  choice=$(echo "$list" | shuf -n 1)
  swaymsg output "$i" bg "$choice" fill
done
