Skip to content

cabraviva/wallpaper-engine-api

Repository files navigation

wallpaper-engine-api

A nodejs wrapper to control your wallpaper engine backgrounds

Install

npm i wallpaper-engine-api

Usage

Import it:

import { WallpaperEngineApi } from 'wallpaper-engine-api'
// or:
const { WallpaperEngineApi } = require('wallpaper-engine-api')

Initialize the Api like this:

// First argument is path to the wallpaper engine install directory, defaults to: "C:\Program Files (x86)\Steam\steamapps\common\wallpaper_engine"
// Second argument is path to wallpaper folder, defaults to: "C:\Program Files (x86)\Steam\steamapps\workshop\content\431960"
// Third argument enables debug logging, defaults to false
// All arguments are optional!
const WE = new WallpaperEngineApi(undefined, undefined, true)

Now you can control your desktop like this:

    WE.desktop().hideIcons()

    await sleep(2000)

    WE.desktop().showIcons()

    WE.controls().mute()
    WE.controls().unmute()

    WE.controls().pause()

    await sleep(3000)
    
    WE.controls().play()

    await sleep(2000)

    WE.controls().stop()

    await sleep(2000)

    WE.controls().play()

    await sleep(1000)

    const wallpapers = await WE.listWallpapers()
    const profiles = await WE.listProfiles()

    // console.log(wallpapers)
    // console.log(profiles)
    // console.log(await WE.getConfig())

    const currentWallpaper = await WE.wallpaper().current()
    // console.log(currentWallpaper)

    for (const profile of profiles) {
        await WE.profile().load(profile)
        await sleep(2000)
    }

    await WE.wallpaper().load(currentWallpaper.id)

    await sleep(1000)

    // Properties
    await WE.wallpaper().applyProperties(currentWallpaper.properties)
    

Note: For compatibility with the api of the wallpaper-engine-api-remote package all methods are asynchronous even if they wouldn't require it.

About

A nodejs wrapper to control your wallpaper engine backgrounds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published