Created
June 30, 2014 08:15
-
-
Save kaleocheng/40c56aaf23512260af11 to your computer and use it in GitHub Desktop.
随机换壁纸
This file contains hidden or 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
#!/usr/bin/env bash | |
#Fielname: shiftwallpaper(.sh) | |
WALLPAPER_DIR='/home/kaleo/images/wallpapers/shared' | |
WAIT=1800 | |
function load_wallpapers() | |
{ | |
n=0 | |
for wallpaper in "$1/*";do | |
wallpaper_list[n]=$wallpaper | |
let n=$n+1 | |
done | |
} | |
function rotate_wallpapers() | |
{ | |
for wallpaper in ${wallpaper_list[@]};do | |
feh --bg-fill $wallpaper | |
sleep $1 | |
done | |
} | |
while true;do | |
load_wallpapers $WALLPAPER_DIR | |
rotate_wallpapers $WAIT | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment