5 ms·
Well, you can run something like curl http://artpip.com/api/featured | jq ".artworks[0].url" | xargs -n1 curl > /tmp/wall.jpg && feh --bg-fill
by helb 9y ago
Well, you can run something like
curl http://artpip.com/api/featured |
jq ".artworks[0].url" |
xargs -n1 curl > /tmp/wall.jpg &&
feh --bg-fill /tmp/wall.jpg
via crontab every morning or so. But the dev(s) might not be happy about it (although the image itself is downloaded from Wikimedia, not artpip.com).
- mcjiggerlog 9y agoFine by me. I think I've been convinced to make a lightweight command line version of the app anyway, so in the future there should be a prepackaged way of doing the above.
- Foxboron 9y agoImproved it a little bit. Selects a random image from the feature list. #!/bin/bash curl -s http://artpip.com/api/featured | jq -r '.artworks | map(.url) | join("\n")' | shuf -n 1 | xargs curl -s > /tmp/wall.jpg && feh --bg-fill /tmp/wall.jpg
- helb 9y agoHeh, i ended up doing that, too. It's possible to just replace jq ".artworks[0].url" with jq ".artworks[$((RANDOM % 5))].url" …at least in bash and zsh. But your version will work better if there ever are more (or less) than 5 featured items.