#!/bin/sh dir="$HOME/Pictures/Wallpapers" list=$(/usr/bin/ls "$dir") for i in $( swaymsg -t get_outputs | grep "name" | awk '{print $2}' | sed s/\"//g | sed s/,//g ) do choice=$(echo "$list" | shuf -n 1) swaymsg output "$i" bg "$dir/$choice" fill done