Wallhaven

A command-line tool to fetch wallpapers from Wallhaven and set them as your desktop background.

Installation

Add this line to your application's Gemfile:

gem 'wallhaven-cli'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install wallhaven-cli

Usage

First, set your Wallhaven API key (optional, but recommended):

export WALLHAVEN_API_KEY=your_api_key_here

Search for wallpapers

wallhaven search nature

You can add options:

wallhaven search mountains --categories=100 --purity=100 --sorting=random

Categories are represented as a 3-digit string where each digit represents whether to include General, Anime, and People categories respectively.

Purity is a 3-digit string where each digit represents whether to include SFW, Sketchy, and NSFW content respectively.

Set a random wallpaper

wallhaven random

With filtering:

wallhaven random --categories=110 --purity=100

Set a specific wallpaper by ID

wallhaven set j3m8y5

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.