Created
July 25, 2018 17:18
-
-
Save shibatch/f0284e3d5bcda8369b2f7a9b4fe49872 to your computer and use it in GitHub Desktop.
Cygwin shell script for automatically collecting Windows spotlight wallpapers
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
#!/usr/bin/bash | |
PATH=/bin:/usr/bin:$PATH | |
LASTDATE=INIT | |
while true; do | |
CURDATE=`date +'%D'` | |
if [ "$CURDATE" != "$LASTDATE" ] | |
then | |
for i in `cygpath $USERPROFILE`/AppData/Local/Packages/Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy/LocalState/Assets/*; do | |
if [ "`file $i | perl -pe 's|.* ([0-9]+x[0-9]+),.*|\1|'`" = 1920x1080 ] | |
then | |
cp -uv $i /cygdrive/d/wallpaper_horizontal/`basename $i`.jpg | |
fi | |
if [ "`file $i | perl -pe 's|.* ([0-9]+x[0-9]+),.*|\1|'`" = 1080x1920 ] | |
then | |
cp -uv $i /cygdrive/d/wallpaper_vertical/`basename $i`.jpg | |
fi | |
done | |
fi | |
LASTDATE=$CURDATE | |
sleep 600 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment