wallpaperex
TypeScript icon, indicating that this package has built-in type declarations

4.4.1 • Public • Published

wallpaper Build Status Build status

Get or set the desktop wallpaper

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

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 for 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.

.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 macOS and Windows

Type: string
Values: auto fill fit stretch center tile
Default: fill

Scaling method.

.screens() (macOS only)

Returns a promise for the available screens.

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

Related

License

MIT © Tony Song

Package Sidebar

Install

npm i wallpaperex

Weekly Downloads

1

Version

4.4.1

License

MIT

Unpacked Size

11.8 MB

Total Files

24

Last publish

Collaborators

  • tonysong