Wallpaper manager with unsplash.com integration
Project description
splashpaper
Turn Unsplash into a desktop wallpaper.
Works on Windows, most Linux DEs and macOS
Warning: on macOS, when changing wallpaper, Dock restarts and screen may freeze for half a second.
Installation
To use this script, you need Python 3.6+ and pip installed.
Then, just run:
python -m pip install splashpaper
Getting help
It's as simple as:
python -m splashpaper --help
That would print help (mostly the same information as below, but shorter)
Usage
Basic
Basic usage is simple:
python -m splashpaper
But that would set a random picture! Not really cool...
Resolution
First of all, the script currently doesn't know your screen resolution.
Provide it with -r
/--resolution
option to fetch smaller picture, e.g:
python -m splashpaper --resolution 1920x1080
Sources
Then you'd probably want some specific images.
Splashdesktop got your back here!
You can provide four types of sources (and combine them), each with as many sources as you want:
Search terms with -s
/--search
option:
python -m splashpaper --search sea ocean water
Collections with -c
/--collections
option (that's my dark wallpapers collection, by the way):
python -m splashpaper --collections 22546183
User photos with -u
/--users
option:
python -m splashpaper --users erondu aditya1702
User likes with -l
/--likes
option:
python -m splashpaper --likes qevitta erondu
Modifiers
There are three modifiers:
--featured
: Use photos picked by Unsplash editors.--daily
: Use photo of the day.--weekly
: Use photo of the week (overrides--daily
).
These can be used with any combination of sources.
Slideshow
If you want to change wallpaper once in a while, you can set interval in seconds with -i
/--interval
:
python -m splashpaper --interval 600
Autostart
If this wasn't obvious, you need to add this script to autostart if you want it to work continiously.
Examples
Photos from my collection of wallpapers, changing every minute
python -m splashpaper --resolution 1920x1080 --collections 9943257 --interval 60
Photo of the day from my collection of wallpapers
python -m splashpaper --resolution 1920x1080 --collections 9943257 --daily
Water photos, changing every 10 minutes
python -m splashpaper --resolution 1920x1080 --search water ocean sea --interval 600
Featured photo of the day
python -m splashpaper --resolution 1920x1080 --featured --daily
Using as a module
You can use script as a module, using dictionary of options as args
:
from splashpaper import main_action
from time import sleep
args = {
"collections": ["9943257"],
"resolution": "1920x1080",
}
while True:
main_action(args)
sleep(60)
Functions
Script uses a very modular workflow.
By default, script calls main_loop(args)
, which in turn calls main_action(args)
once or with interval.
main_action(args)
is defined as:
def main_action(args):
return set_wallpaper(
download_file(
build_url(args),
abspath(dirname(__file__)) + "/wallpaper.jpg"
)
)
This snippet shows that:
- To build a URL based on your args, script uses
build_url(args)
- To download a picture from that URL, script uses
download(url, path)
, which returns path - To set picture as a wallpaper, script uses
set_wallpaper(path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file splashpaper-1.1.0.tar.gz
.
File metadata
- Download URL: splashpaper-1.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d632532f9ed49ad12e6f84934cf8141cce1b8d63855094b91225dfe99204af00 |
|
MD5 | de870b9273bd12aebd7893ebe716c5f2 |
|
BLAKE2b-256 | ea33b1e8354e1a301d0aef7d5eb2df000bd750a8da88004da3d7acf210f75164 |