New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@xchencode/macos-wallpaper

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xchencode/macos-wallpaper

Manage the desktop wallpaper

latest
Source
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

wallpaper

Get or set the desktop wallpaper

Works on macOS 10.14.4+.

Install

npm install macos-wallpaper

Usage

import {getWallpaper, setWallpaper} from 'wallpaper';

await setWallpaper('unicorn.jpg');

await getWallpaper();
//=> '/Users/sindresorhus/unicorn.jpg'

API

getWallpaper(options?)

Returns a Promise<string> with the path of the current desktop wallpaper.

options

Type: object

screen

Type: string | number
Values: 'all', 'main', or the index of a screen from .screens()
Default: 'main'

The screen to get the wallpaper from.

If you set 'all' then getWallpaper() will return a Promise<string[]>.

setWallpaper(imagePath, options?)

Returns a Promise.

imagePath

Type: string

The path to the image to set as the desktop wallpaper.

options

Type: object

screen

Type: string | number
Values: 'all', 'main', or the index of a screen from .screens() Default: 'all'

The screen to set the wallpaper on.

scale

Type: string
Values: 'auto' | 'fill' | 'fit' | 'stretch' | 'center'
Default: 'auto'

fillColor

Type: string

The color to set as a RGB Hex value. For example, 000000 for black.

Scaling method.

setSolidColorWallpaper(color, options?)

Returns a Promise.

color

Type: string

The color to set as a RGB Hex value. For example, 000000 for black.

options

Type: object

screen

Type: string | number
Values: 'all', 'main', or the index of a screen from .screens() Default: 'all'

The screen to set the wallpaper on.

import {setSolidColorWallpaper} from 'wallpaper';

await setSolidColorWallpaper('000000');

screens()

Returns a Promise<string[]> with the available screens.

import {screens} from 'wallpaper';

await screens();
//=> ['Color LCD']
  • macos-wallpaper - macOS binary used in this module

Keywords

macos

FAQs

Package last updated on 03 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts