-
-
Save Lokawn/4c89d6a5f5cb2237bc1ef52128d36822 to your computer and use it in GitHub Desktop.
This is a simple random wallpaper changer to use with Awesome WM. You need to install feh to use this.
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 | |
# | |
# Created by djazz // Dangershy | |
# Dependencies: feh | |
# | |
FOLDER="~/Pictures/wallpapers" | |
DELAY=10 | |
# to make it loop over lines instead of spaces in filenames | |
IFS=$'\n'; | |
while true; do | |
LIST=`find "$FOLDER" -type f \( -name '*.jpg' -o -name '*.png' \) | shuf` | |
for i in $LIST; do | |
echo "$i" | |
# gsettings set org.gnome.desktop.background picture-uri "file://$i" | |
feh "$i" --bg-fill | |
# pcmanfm -w "$i" | |
sleep ${DELAY}m | |
done | |
sleep 1 | |
done | |
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 | |
# | |
# Created by djazz | |
# Dependencies: curl | |
# You need Gnome or feh, depending on what DE/WM you use | |
# | |
IMGLIST="http://djazz.se/pony/wallpapers/images.txt" | |
IMGSCRIPT="http://djazz.se/pony/wallpapers/image.php" | |
DELAY=10 | |
DOWNLOAD_DIR=/tmp | |
USE_GNOME=0 # uses /tmp | |
USE_FEH=1 | |
# to make it loop over lines instead of spaces in filenames | |
IFS=$'\n'; | |
while true; do | |
LIST=`curl -s "${IMGLIST}" | shuf` | |
for i in $LIST; do | |
echo "$i" | |
if [ "$USE_GNOME" -eq 1 ]; then | |
curl -s -G "${IMGSCRIPT}" --data-urlencode "f=$i" -o "$DOWNLOAD_DIR/next-wallpaper" | |
mv "$DOWNLOAD_DIR/next-wallpaper" "$DOWNLOAD_DIR/wallpaper" | |
gsettings set org.gnome.desktop.background picture-uri "file://$DOWNLOAD_DIR/wallpaper" | |
fi | |
if [ "$USE_FEH" -eq 1 ]; then | |
curl -s -G "${IMGSCRIPT}" --data-urlencode "f=$i" | feh - --bg-fill & | |
fi | |
sleep ${DELAY}m | |
done | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment