node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

win-wallpaper

node-win-wallpaper

Get or set the desktop wallpaper on Windows using the win-wallpaper binary

Install

$ npm install --save win-wallpaper

Usage

var winWallpaper = require('win-wallpaper');
 
winWallpaper.set('unicorn.jpg', function (err) {
    console.log('done');
});
 
winWallpaper.get(function (err, imagePath) {
    console.log(imagePath);
    //=> 'C:\Users\sindresorhus\unicorn.jpg' 
});

API

.get(callback)

callback(error, imagePath)

Required
Type: function

imagePath

Type: string

Path to the current desktop wallpaper image.

.set(imagePath, [callback])

imagePath

Required
Type: string

Path to the image to set as the desktop wallpaper.

CLI

# set 
wallpaper unicorn.jpg
 
# get 
wallpaper
> C:\Users\sindresorhus\unicorn.jpg

Related

  • wallpaper - Get or set the desktop wallpaper.

License

MIT © Sindre Sorhus