2018-08-20 19:58:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
shopt -s nullglob
|
2020-03-25 19:26:51 +00:00
|
|
|
|
2018-08-20 19:58:12 +00:00
|
|
|
#===change these config start===
|
|
|
|
|
|
|
|
#wallpapers directory path
|
|
|
|
path=~/Pictures/Wallpapers
|
|
|
|
|
|
|
|
#time interval
|
|
|
|
interval=5m
|
|
|
|
|
|
|
|
#===change these config end===
|
|
|
|
|
|
|
|
cd $path
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
files=()
|
|
|
|
|
|
|
|
for i in *.jpg *.png; do
|
|
|
|
[[ -f $i ]] && files+=("$i")
|
|
|
|
done
|
|
|
|
range=${#files[@]}
|
2020-03-25 19:26:51 +00:00
|
|
|
|
2018-08-20 19:58:12 +00:00
|
|
|
((range)) && feh --bg-scale "${files[RANDOM % range]}"
|
2020-03-25 19:26:51 +00:00
|
|
|
|
2018-08-20 19:58:12 +00:00
|
|
|
sleep $interval
|
|
|
|
done
|