Last active
December 19, 2016 21:26
-
-
Save zviryatko/055f8f4850bf17323c4f127a4daeccdf to your computer and use it in GitHub Desktop.
Get random wallpaper from http://desktoppr.co/
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 | |
# Download random wallpaper from desktoppr.co | |
# Save this file: | |
# $ curl -s https://gist.githubusercontent.com/zviryatko/055f8f4850bf17323c4f127a4daeccdf/raw/random-wallpaper.sh > $HOME/.local/bin/random-wallpaper | |
# $ chmod a+x $HOME/.local/bin/random-wallpaper | |
# $ crontab -e | |
# and add this line to the end: | |
# */20 * * * * $HOME/.local/bin/random-wallpaper | |
IMG_PATH="$HOME/.cache/wallpaper.jpg" | |
curl -s `curl -s https://api.desktoppr.co/1/wallpapers/random | python -c "import json,sys; obj=json.load(sys.stdin); print obj['response']['image']['url'];"` > $IMG_PATH | |
# I've used "feh" for setting bg image, you can install it with `apt-get install feh` | |
DISPLAY=:0.0 feh --bg-fill $IMG_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment