Desktop Wallpaper Rotation
One of the advantages of Linux is the ability to extend it in relatively easy way. The easier the better.
Here is my solution for automatic wallpaper rotation solution that is automatically downloading wallpapers from the unsplash.com page. It provides easy to use API that allows get random wallpaper based on the provided parameters. To use this API, you need to have user account and a token. Free version allows for 1000 requests per day, so it should be enough.
#!/bin/bash
QUERY="&query=${1}"
UNSPLASH_URL="https://api.unsplash.com/photos/random"
UNSPLASH_TOKEN="secret_token"
WALLPAPER_URL=$(curl -s "${UNSPLASH_URL}?client_id=${UNSPLASH_TOKEN}&orientation=landscape$QUERY" | jq -r ".urls.full")
gsettings set org.gnome.desktop.background picture-uri '${WALLPAPER_URL}'
Run the the script with or without the parameter. If the parameter is provided, API will match the returned wallpaper to match the parameter.
Some examples:
wallpaper.sh tank # will set wallpaper with tank theme
wallpaper.sh mountains – will set wallpaper with mountains theme
wallpaper.sh # will set random wallpaper
There is an RSS feed for this blog.