Socket
Socket
Sign inDemoInstall

wallpaper

Package Overview
Dependencies
0
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wallpaper

Manage the desktop wallpaper


Version published
Weekly downloads
608
increased by14.5%
Maintainers
1
Install size
10.9 MB
Created
Weekly downloads
 

Readme

Source

wallpaper Build Status Build status

Get or set the desktop wallpaper

Works on macOS, Linux, and Windows.

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

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 for an array of screens.

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

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 29 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc