dot_testing/utils/sh/wallpaper

33 lines
517 B
Bash
Executable File

#!/bin/sh
WALLDIR="${HOME}/.local/share/wallpapers"
BASECMD="feh --no-fehbg --bg-fill"
generate_wall () {
GENWALL=$( \
ls "$WALLDIR" | \
grep "." | \
shuf -n 1
)
GENWALL="${WALLDIR}/${GENWALL}"
}
wall () {
generate_wall
while [ "${GENWALL}" = "${1}" ]; do
generate_wall
done
}
displays () {
displays=$(xrandr | grep -c ' connected')
}
cmd=""
displays
for i in $(seq 1 "$displays"); do
wall "${tmp}"
tmp="${GENWALL}"
cmd="${cmd} ${GENWALL}"
done
eval "${BASECMD}" "${cmd}"
exit 0