sindresorhus / wallpaper

Manage the desktop wallpaper
MIT License
1.05k stars 92 forks source link

Not setting wallpaper on all Desktops on macOS #95

Closed FormalSnake closed 8 months ago

FormalSnake commented 8 months ago

It only sets it on one Desktop. Here is my code:

import { getWallpaper, setWallpaper } from "wallpaper";
import fs from "fs"

var files = fs.readdirSync('./wallpapers/')

const options = {
  screen: 'all'
};

export function changePaper(){
let img = "wallpapers/" + files[Math.floor(Math.random() * files.length)]
  setWallpaper(img, options)
  console.log(img)
}

changePaper()
sindresorhus commented 8 months ago

Duplicate of https://github.com/sindresorhus/wallpaper/issues/31