How to use the wallpaper.get function in wallpaper

To help you get started, we’ve selected a few wallpaper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tma02 / spotispy-wallpaper / lib / main.js View on Github external
const app = electron.app;
const globalShortcut = electron.globalShortcut;

let screen;
let displays;
let currentDisplay = 0;
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow;
const Menu = electron.Menu;
const Tray = electron.Tray;

const ipc = require('electron').ipcMain;

const wallpaper = require('wallpaper');
let oldWallpaper;
wallpaper.get().then(imagePath => {
  oldWallpaper = imagePath;
  console.log(oldWallpaper);
});
let fileName = 'temp.png';

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
let appIcon;

function createWindow () {
  // Create the browser window.
  mainWindow = new BrowserWindow({width: 1366, height: 790, frame: false, skipTaskbar: true, enableLargerThanScreen: true});
  app.dock.hide();

  // and load the index.html of the app.
github splash-cli / splash-cli / src / extra / utils.js View on Github external
{
				name: 'addToCollection',
				message: 'Do you want add this photo to a collection?',
				type: 'confirm',
				default: false,
				when: () => promptCollection && !flags.quiet,
			},
		]);

		if (!confirmed && confirmWallpaper) {
			const lastWP = config.get('lastWP');
			wallpaper.set(lastWP);
			return;
		}

		const currentWallpaper = await wallpaper.get();
		config.set('lastWP', currentWallpaper);

		if (liked === true && promptLike) {
			const id = photo._id || photo.id;

			try {
				await User.likePhoto(id);

				console.log();
				console.log('Photo liked.');
			} catch (error) {
				errorHandler(error);
			}
		}

		if (addToCollection === true && promptCollection) {
github samuelcarreira / dynamic-time-shifting-desktop / src / dynamic-wallpaper.js View on Github external
return new Promise((resolve, reject) => {
            wallpaper.get()
                .then(file => {
                    resolve(file);
                })
                .catch(err => {
                    //global.Log.error(`Get current System Wallpaper: ${err}`);
                    reject(err);
                });
        });
    }
github splash-cli / splash-cli / src / client.js View on Github external
spinner.succeed = emptyFunction;
		}
	}

	if (!config.get('directory') || !config.has('directory')) {
		config.set('directory', pathFixer('~/Pictures/splash_photos'));
	}

	if (fs.existsSync(config.get('directory'))) {
		mkdirp(config.get('directory'), (error) => {
			if (error) return errorHandler(error);
		});
	}

	if (!config.has('lastWP') || !config.get('lastWP')) {
		const lastWP = await wallpaper.get();
		config.set('lastWP', lastWP);
	}

	updateNotifier({ pkg: manifest, updateCheckInterval: 1000 * 30 }).notify();

	if (frun()) {
		await clearSettings();
		await Unsplash.shared.picOfTheDay();

		Sentry.captureMessage('New User', Sentry.Severity.Info);

		printBlock(
			chalk`Welcome to ${manifest.name}@{dim ${manifest.version}} {bold @${userInfo().username}}`,
			'',
			chalk`{dim CLI setup {green completed}!}`,
			'',
github marvin-js / marvin / src / commands / wallpaper.js View on Github external
export default function (opts, path) {
  if (path) {
    return wallpaper.set(path);
  }

  return wallpaper.get();
}
github soroushchehresa / unsplash-wallpapers / app / containers / History / index.jsx View on Github external
componentDidMount() {
    this.getLocalPhotos();
    wallpaper.get()
      .then((path) => {
        this.setState({ currentWallpaper: path });
      });
  }

wallpaper

Manage the desktop wallpaper

MIT
Latest version published 9 months ago

Package Health Score

61 / 100
Full package analysis

Popular wallpaper functions