macos wallpaper
v2.3.2
MacOS에서 데스크탑 벽지를 관리하십시오
이것은 명령 줄 앱과 신속한 패키지입니다.
벽지가 디렉토리로 설정된 경우에도 활성 벽지를 올바르게 처리합니다.
MacOS 10.14.4 이상이 필요합니다.
brew install wallpaper 이진을 다운로드하여 /usr/local/bin 에 넣으십시오.
기본적으로 모든 화면의 벽지를 설정하고 가져옵니다. --screen 플래그를 사용하여 이것을 변경하십시오.
$ wallpaper
USAGE: wallpaper <subcommand>
OPTIONS:
--version Show the version.
-h, --help Show help information.
SUBCOMMANDS:
get Get current wallpaper images.
set Set image as wallpaper.
set-solid-color Set solid color as wallpaper.
screens Get a list of available screens.
$ wallpaper get --help
OVERVIEW: Get current wallpaper images.
USAGE: wallpaper get [--screen <screen>]
OPTIONS:
--screen <screen> Values: all, main, <index> (default: all)
$ wallpaper set --help
OVERVIEW: Set image as wallpaper.
USAGE: wallpaper set <path> [--screen <screen>] [--scale <scale>] [--fill-color <fill-color>]
ARGUMENTS:
<path> The path to the image to use as wallpaper.
OPTIONS:
--screen <screen> Values: all, main, <index> (default: all)
--scale <scale> Values: auto, fill, fit, stretch, center (default: auto)
--fill-color <fill-color>
Format: Hex color <RRGGBB>
$ wallpaper set-solid-color --help
OVERVIEW: Set solid color as wallpaper.
USAGE: wallpaper set-solid-color <color> [--screen <screen>]
ARGUMENTS:
<color> The color to use as wallpaper.
OPTIONS:
--screen <screen> Values: all, main, <index> (default: all)
wallpaper set unicorn.jpgwallpaper set-solid-color 0000ffwallpaper get
/Users/sindresorhus/unicorn.jpg이것을 구축하려면 최신 Xcode 및 MacOS 버전이 필요합니다. 패키지는 MacOS 10.14.4 이상을 지원합니다.
Package.swift 에 다음을 추가하십시오.
. package ( url : " https://github.com/sindresorhus/macos-wallpaper " , from : " 2.3.2 " )또는 Xcode에 패키지를 추가하십시오.
import Wallpaper
let imageURL = URL ( fileURLWithPath : " <path> " , isDirectory : false )
try ! Wallpaper . set ( imageURL , screen : . main , scale : . fill )
let solidColor = NSColor . blue
try ! Wallpaper . set ( solidColor , screen : . main )
print ( try ! Wallpaper . get ( screen : . main ) )더 많은 소스를 참조하십시오.
swift run wallpaperswift build --configuration=release --arch arm64 --arch x86_64 && mv .build/apple/Products/Release/wallpaper . Do Not Disturb