Get or set the desktop wallpaper
Works on macOS, Linux, and Windows.
$ npm install @zerox-dg/wallpaper
const wallpaper = require("wallpaper");
wallpaper.set("unicorn.jpg").then(() => {
console.log("done");
});
wallpaper.get().then(imagePath => {
console.log(imagePath);
//=> '/Users/sindresorhus/unicorn.jpg'
});
Returns a promise for the path of the current desktop wallpaper.
Returns a promise.
Type: string
Path to the image to set as the desktop wallpaper.
Type: Object
Type: string
Values: fill
fit
stretch
center
Default: Current system setting
Scaling method. Only available on macOS.
- wallpaper-cli - CLI for this module
- macos-wallpaper - macOS binary used in this module
- win-wallpaper - Windows binary used in this module
MIT © Sindre Sorhus