Popularity
4.9
Growing
Activity
5.1
Declining
628
13
55

Monthly Downloads: 0
Programming language: JavaScript
License: MIT License
Tags: Command Line Apps     Image     Linux     Windows     Win     Osx     Picture     Photo     Background     Desktop     Wallpaper     Macos    

wallpaper alternatives and similar modules

Based on the "Command Line Apps" category

Do you think we are missing an alternative of wallpaper or a related project?

Add another 'Command Line Apps' Module

README

wallpaper Build Status Build status

Get or set the desktop wallpaper

Works on macOS 10.12+, Linux, and Windows 10+.

Maintainer needed for the Linux part of the code. No new Linux-related changes will be accepted until someone with good Linux knowledge volunteers.

Install

$ npm install wallpaper

Usage

const wallpaper = require('wallpaper');

(async () => {
    await wallpaper.set('unicorn.jpg');

    await wallpaper.get();
    //=> '/Users/sindresorhus/unicorn.jpg'
})();

API

.get(options?)

Returns a Promise<string> with the path of the current desktop wallpaper.

options

Type: object

screen (macOS only)

Type: string | number Values: 'all', 'main', or the index of a screen from .screens() Default: 'main'

The screen to get the wallpaper from.

If you set 'all' then .get() will return a Promise<string[]>.

.set(imagePath, options?)

Returns a Promise.

imagePath

Type: string

The path to the image to set as the desktop wallpaper.

options

Type: object

screen (macOS only)

Type: string | number Values: 'all', 'main', or the index of a screen from .screens() Default: 'all'

The screen to set the wallpaper on.

On Linux and Windows it's hard-coded to 'main'.

scale (macOS only)

Type: string Values: 'auto' | 'fill' | 'fit' | 'stretch' | 'center' Default: 'auto'

Scaling method.

.screens() (macOS only)

Returns a Promise<string[]> with the available screens.

(async () => {
    await wallpaper.screens();
    //=> ['Color LCD']
})();