antonin-lebrard / wallpaper

Get or set the desktop wallpaper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modification of https://github.com/sindresorhus/wallpaper to make available scaling options for linux under GNOME environment supporting gsettings (tested on ubuntu 16.04)

Original README :

wallpaper

Get or set the desktop wallpaper

Works on macOS, Linux, and Windows.

Install

$ npm install --save wallpaper

Usage

const wallpaper = require('wallpaper');

wallpaper.set('unicorn.jpg').then(() => {
	console.log('done');
});

wallpaper.get().then(imagePath => {
	console.log(imagePath);
	//=> '/Users/sindresorhus/unicorn.jpg'
});

API

.get()

Returns a promise for the path of the current desktop wallpaper.

.set(imagePath, [options])

Returns a promise.

imagePath

Type: string

Path to the image to set as the desktop wallpaper.

options

Type: Object

scale

Type: string
Values: fill fit stretch center
Default: Current system setting

Scaling method. Only available on macOS. Now available for Linux under GNOME

Related

License

MIT © Sindre Sorhus

About

Get or set the desktop wallpaper

License:MIT License


Languages

Language:JavaScript 100.0%