Downloads a random picture from Unsplash and updates the desktop wallpaper every hour.
- Follow the setup step for the image provider of your choice.
Note: Currently only
unsplash
is supported as image provider.
- Clone this repository.
$ git clone https://github.com/silwalanish/wallpapr.git
- Change directory into
wallpapr
.
$ cd wallpapr
- Build the project.
$ make build
- Install the project.
$ make install
$ wallpapr [-h] [-c] [-s] [-p {unsplash}]
optional arguments:
-h, --help show this help message and exit
-c, --get-current-path
Get the current background path.
-s, --only-set-current
Set the current background without downloading.
-p {unsplash}, --image-provider {unsplash}
Set the image provider to use.
The configurations is available at ~/.config/wallpapr/wallpapr.json
.
Property | Description | Type | Default |
---|---|---|---|
width |
Hints the width of the image to download from the selected image_provider . |
Number | 1360 |
height |
Hints the height of the image to download from the selected image_provider . |
Number | 768 |
current_wallpaper_path |
Defines the full path to the current wallpaper. If you manually update the path, run the command $ wallpapr -c to set the image as the wallpaper. Note: This will only reflect correctly if the current wallpaper was set with wallpapr |
String | None |
download_path |
Defines the full path to the directory where the image is to be downloaded. | String | $HOME/Pictures |
image_provider |
Defines the default image provider to use. You can override the default image_provider in the CLI using --image-provider or -p option Note: Currently, only unsplash is a valid option. |
String | unsplash |
image_provider_config |
Defines the configurations to provide to the image provider. | JSON | See documentation for the image_provider |
Note: Unsplash is the default and the only (for now) image provider for
wallpapr
.
wallpapr
uses the /photo/random
API provided by Unsplash to get the random image. The configurations are a subset of the ones described for the API in the Unsplash official documentation.
- Register an Unsplash app and get the secret key and access key.
- Export the secret key (as
UNSPLASH_SECRET_KEY
) and access key (asUNSPLASH_ACCESS_KEY
).
$ export UNSPLASH_SECRET_KEY="secret_key"
$ export UNSPLASH_ACCESS_KEY="access_key"
Note: You can add these command at the end of ~/.profile to export it globally for the current user. This is required for wallpapr cli.
- Once
wallpapr
is installed setimage_provider
tounsplash
in the configuration file. See configuring wallpapr.
Property | Description | Type | Default |
---|---|---|---|
orientation |
Filter by photo orientation. (Valid values: landscape , portrait , squarish ). Note: Multiple values are supported as either comma separated string or a list of string. |
String or Array[String] | landscape |
collections |
Public collection ID(‘s) to filter selection. The collection id can be found in the web url for the collection. Note: Multiple values are supported as either comma separated string or a list of ids or a list of JSON object with id and url (optional; web url to the unsplash collection.) |
String or Array[String] or Array[Number] or Array[{id, url}] | See Default Unsplash Collections |
[
{
"id": "606028",
"url": "https://unsplash.com/collections/606028/technology"
},
{
"id": "11649432",
"url": "https://unsplash.com/collections/11649432/landscape"
},
{
"id": "827743",
"url": "https://unsplash.com/collections/827743/landscape"
},
{
"id": "2476111",
"url": "https://unsplash.com/collections/2476111/retro-tech"
}
]
- Run uninstall script.
$ make uninstall
- Clean up.
$ cd ..
$ rm -rf wallpapr