wlpr
enables you to randomly cycle between desktop wallpapers on a macOS system from the command line. Written in pure Go
with additional applescript
(for system manipulation), it is a lightweight, simple, and easy to use CLI
application.
Context: Suppose you have a folder of wallpapers on your local machine. You would like to choose a random wallpaper from this folder and set it as the current desktop wallpaper. Furthermore, you would like to check whether the newly selected wallpaper isn't the same as the current one, thus displaying a complete new wallpaper every time. All this shall be done in a single command.
Sounds familiar? wlpr is your friend.
FYI, I'm using this repositery for Nord-themed wallpapers in the demo. For the Nord theme enthusiasts (like myself), create your own here. One last thing, my dotfiles (if anyone is interested) are here.
- Fork the repository
$ git clone -b public --single-branch https://github.com/michalspano/wlpr.git && cd wlpr
- Call the
init
script (from within the repository)
$ ./init <PATH-TO-IMAGE-FOLDER>
*where <PATH-TO-IMAGE-FOLDER>
is the path to the folder containing the images to choose from.
- You are all set!
$ wlpr
If you aren't satisfied with wlpr
, you can remove it (and all the source files) from the system by calling:
$ ./uninstall
NOTE: this script is found within the repository and must be called from within the repository only.
The init
method creates a ~/.wlpr.json
file that contains the path to the folder containing the images to choose from and the root of the folder. This is a crucial piece of information that is used by wlpr
to determine which images to choose from and where to retrieve the scipts from.
- Omit the ending message (default: display the message):
$ wlpr --no-message
$ wlpr -nm
- Print the current version:
$ wlpr --version
$ wlpr -v
*Both of the mentioned variants are valid.
I'm open to any contribution to the repository. If you have any suggestions or feedback, please open an issue or pull request. 👍