#!/bin/env bash

# xrandr | awk '$2 == "connected" && $3 ~ /[0-9]+x[0-9]+\+[0-9]+\+[0-9]+/ { split($3, a, "+"); b[bi] = a[2]; c[bi] = $1; bi++ } END { PROCINFO["sorted_in"] = "@val_num_asc"; d = "feh --bg-center"; for(i in b) { d=d " $HOME/.local/share/le_wallpaper/" c[i] ".png" }; system(d) }'

le-wallpaper-open

xfconf-query -c xfce4-desktop -m | awk -F '/' '
$2 == "backdrop" && $3 == "screen0" && $4 ~ /^monitor/ {
	system("le-wallpaper " substr($4, 8))
}'
