Created
March 31, 2018 13:06
-
-
Save mrf345/8912a139c8614899afcbd57c6eb70239 to your computer and use it in GitHub Desktop.
feh wallpapers setting loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
d=$1 # Directory | |
t=$2 # Duration | |
if [ "$1" == "" ];then | |
d=~/Pictures/Cities | |
fi | |
if [ "$2" == "" ];then | |
t=300 # 5 minuts | |
fi | |
l=$(ls -1q "$d" | wc -l) # number of files | |
while true | |
do | |
rindex=$[ $RANDOM % "$l" ] # start from random position | |
counter=1 | |
for i in $(ls "$d") | |
do | |
img="$d/$i" | |
if [ -f $img ] && [ $counter -gt $rindex ];then | |
feh --bg-scale $img | |
# echo $img | |
sleep "$t"s | |
fi | |
counter=$(($counter + 1)) | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment