reddit-wallpaper
Version:
Downloads the top wallpaper from a list of subreddits and sets it as desktop background.
114 lines (73 loc) • 1.74 kB
Markdown
[](https://travis-ci.org/jmercha/reddit-wallpaper)
[](https://david-dm.org/jmercha/reddit-wallpaper)
Grabs the top image from a list of subreddits and sets it as the desktop wallpaper.
```
npm install -g reddit-wallpaper
```
From node:
```
require('reddit-wallpaper')({
// options
}).then(link => console.log('Background set to ' + link.url));
```
From CLI:
```
reddit-wallpaper
```
For example, you could run it on session logon or as a cronjob.
Example ~/.reddit-wallpaper/config.json
```
{
"subreddits": ["wallpaper", "wallpapers", "castles"],
"sort": "top",
"from": "month",
"score": 100,
"domains": ["i.imgur.com", "imgur.com"],
"types": ["png", "jpg", "jpeg"],
"directory": "~/.reddit-wallpaper",
"shuffle": true,
"resolution": { "width": 1920, "height": 1080 }
}
```
Type: `Array`
List of subreddit names to retrieve links from.
Type: `string`
Sort links by:
- `top`
- `hot`
- `new`
- `controversial`
Type: `string`
Get links from last...
- `hour`
- `day`
- `week`
- `month`
- `all`
Type: `number`
Minimum link score.
Type: `Array`
Domain whitelist.
Type: `string`
Path to save images to.
Type: `boolean`
Filter out wallpapers that have already been downloaded.
Type: `object`
Minimum image resolution, extracted from link title tag: eg. `[1920x1280]`
Type: `number`
Type: `number`