.fehbg now saves its random picks to ~/.cache/wallpapers and redraws them with --keep; screen-layout passes this through with --keep-wallpaper, used by movie.
14 lines
496 B
Bash
Executable File
14 lines
496 B
Bash
Executable File
#!/bin/bash
|
|
# Sets a random wallpaper on each monitor; with --keep, redraws the last ones picked instead.
|
|
|
|
cache=${XDG_CACHE_HOME:-$HOME/.cache}/wallpapers
|
|
|
|
if [[ $1 != --keep || ! -s $cache ]]; then
|
|
# One image per connected output, so --keep still has enough after an output was off
|
|
count=$(xrandr --query | grep -c ' connected')
|
|
shuf -n "$count" -e ~/.local/share/backgrounds/random/* > "$cache"
|
|
fi
|
|
|
|
mapfile -t walls < "$cache"
|
|
exec /usr/bin/feh --no-fehbg --bg-fill "${walls[@]}"
|