3 ms·
Improved 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)
by Foxboron 9y ago
Improved 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.