{"id":13479010,"url":"https://github.com/sindresorhus/macos-wallpaper","last_synced_at":"2025-05-16T13:03:40.237Z","repository":{"id":29805058,"uuid":"33349433","full_name":"sindresorhus/macos-wallpaper","owner":"sindresorhus","description":"Manage the desktop wallpaper on macOS","archived":false,"fork":false,"pushed_at":"2024-09-16T15:44:45.000Z","size":80,"stargazers_count":657,"open_issues_count":14,"forks_count":39,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-11T19:34:08.803Z","etag":null,"topics":["cli","cli-app","desktop-wallpaper","macos","macos-wallpaper","swift-package","wallpaper"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2015-04-03T06:10:14.000Z","updated_at":"2025-05-03T02:47:11.000Z","dependencies_parsed_at":"2024-11-06T01:53:32.571Z","dependency_job_id":"d20a7177-a1c2-4146-a743-a13aacf7bf00","html_url":"https://github.com/sindresorhus/macos-wallpaper","commit_stats":{"total_commits":51,"total_committers":8,"mean_commits":6.375,"dds":0.1568627450980392,"last_synced_commit":"3446ed59c4d2320d7948ac7348e5b171bf84880d"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fmacos-wallpaper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fmacos-wallpaper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fmacos-wallpaper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fmacos-wallpaper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/macos-wallpaper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254473602,"owners_count":22077133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-app","desktop-wallpaper","macos","macos-wallpaper","swift-package","wallpaper"],"created_at":"2024-07-31T16:02:07.632Z","updated_at":"2025-05-16T13:03:40.193Z","avatar_url":"https://github.com/sindresorhus.png","language":"Swift","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["Swift","壁纸","HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# macos-wallpaper\n\n\u003e Manage the desktop wallpaper on macOS\n\nThis is both a command-line app and a Swift package.\n\nIt correctly handles getting the active wallpaper even when the wallpaper is set to a directory.\n\n## CLI\n\n*Requires macOS 10.14.4 or later.*\n\n### Install\n\n###### [Homebrew](https://brew.sh)\n\n```sh\nbrew install wallpaper\n```\n\n###### Manually\n\n[Download](https://github.com/sindresorhus/macos-wallpaper/releases/latest) the binary and put it in `/usr/local/bin`.\n\n### Usage\n\nBy default, it sets and gets the wallpaper for all screens. Use the `--screen` flag to change this.\n\n```\n$ wallpaper\n\nUSAGE: wallpaper \u003csubcommand\u003e\n\nOPTIONS:\n  --version               Show the version.\n  -h, --help              Show help information.\n\nSUBCOMMANDS:\n  get                     Get current wallpaper images.\n  set                     Set image as wallpaper.\n  set-solid-color         Set solid color as wallpaper.\n  screens                 Get a list of available screens.\n```\n\n```\n$ wallpaper get --help\n\nOVERVIEW: Get current wallpaper images.\n\nUSAGE: wallpaper get [--screen \u003cscreen\u003e]\n\nOPTIONS:\n  --screen \u003cscreen\u003e       Values: all, main, \u003cindex\u003e (default: all)\n```\n\n```\n$ wallpaper set --help\n\nOVERVIEW: Set image as wallpaper.\n\nUSAGE: wallpaper set \u003cpath\u003e [--screen \u003cscreen\u003e] [--scale \u003cscale\u003e] [--fill-color \u003cfill-color\u003e]\n\nARGUMENTS:\n  \u003cpath\u003e                  The path to the image to use as wallpaper.\n\nOPTIONS:\n  --screen \u003cscreen\u003e       Values: all, main, \u003cindex\u003e (default: all)\n  --scale \u003cscale\u003e         Values: auto, fill, fit, stretch, center (default: auto)\n  --fill-color \u003cfill-color\u003e\n                          Format: Hex color \u003cRRGGBB\u003e\n```\n\n```\n$ wallpaper set-solid-color --help\n\nOVERVIEW: Set solid color as wallpaper.\n\nUSAGE: wallpaper set-solid-color \u003ccolor\u003e [--screen \u003cscreen\u003e]\n\nARGUMENTS:\n  \u003ccolor\u003e                 The color to use as wallpaper.\n\nOPTIONS:\n  --screen \u003cscreen\u003e       Values: all, main, \u003cindex\u003e (default: all)\n```\n\n##### Set\n\n```sh\nwallpaper set unicorn.jpg\n```\n\n##### Set solid color\n\n```sh\nwallpaper set-solid-color 0000ff\n```\n\n##### Get\n\n```sh\nwallpaper get\n/Users/sindresorhus/unicorn.jpg\n```\n\n## API\n\n*Building this requires the latest Xcode and macOS version. The package supports macOS 10.14.4 or later.*\n\n### Install\n\nAdd the following to `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/sindresorhus/macos-wallpaper\", from: \"2.3.2\")\n```\n\n[Or add the package in Xcode.](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app)\n\n### Usage\n\n```swift\nimport Wallpaper\n\nlet imageURL = URL(fileURLWithPath: \"\u003cpath\u003e\", isDirectory: false)\ntry! Wallpaper.set(imageURL, screen: .main, scale: .fill)\n\nlet solidColor = NSColor.blue\ntry! Wallpaper.set(solidColor, screen: .main)\n\nprint(try! Wallpaper.get(screen: .main))\n```\n\nSee the [source](Sources/wallpaper/Wallpaper.swift) for more.\n\n## Dev\n\n### Run\n\n```sh\nswift run wallpaper\n```\n\n### Build\n\n```sh\nswift build --configuration=release --arch arm64 --arch x86_64 \u0026\u0026 mv .build/apple/Products/Release/wallpaper .\n```\n\n## Related\n\n- [wallpaper](https://github.com/sindresorhus/wallpaper) - Get or set the desktop wallpaper cross-platform *(Uses this binary)*\n- [macos-trash](https://github.com/sindresorhus/macos-trash) - Move files and directories to the trash\n- [do-not-disturb](https://github.com/sindresorhus/do-not-disturb) - Control the macOS `Do Not Disturb` feature\n- [More…](https://github.com/search?q=user%3Asindresorhus+language%3Aswift+archived%3Afalse\u0026type=repositories)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fmacos-wallpaper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fmacos-wallpaper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fmacos-wallpaper/lists"}