{"id":13835710,"url":"https://github.com/zero-sh/apply-user-defaults","last_synced_at":"2025-03-16T18:31:55.844Z","repository":{"id":54772821,"uuid":"227713994","full_name":"zero-sh/apply-user-defaults","owner":"zero-sh","description":"A small utility to set macOS user defaults declaratively from a YAML file.","archived":false,"fork":false,"pushed_at":"2023-08-24T22:49:10.000Z","size":74,"stargazers_count":70,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T04:41:15.267Z","etag":null,"topics":["declarative","defaults","dotfiles","dotfiles-macos","macos","user","yaml"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zero-sh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-12T23:17:04.000Z","updated_at":"2025-03-15T20:34:13.000Z","dependencies_parsed_at":"2022-08-14T02:20:38.437Z","dependency_job_id":null,"html_url":"https://github.com/zero-sh/apply-user-defaults","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-sh%2Fapply-user-defaults","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-sh%2Fapply-user-defaults/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-sh%2Fapply-user-defaults/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zero-sh%2Fapply-user-defaults/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zero-sh","download_url":"https://codeload.github.com/zero-sh/apply-user-defaults/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910667,"owners_count":20367546,"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":["declarative","defaults","dotfiles","dotfiles-macos","macos","user","yaml"],"created_at":"2024-08-04T14:01:10.336Z","updated_at":"2025-03-16T18:31:53.379Z","avatar_url":"https://github.com/zero-sh.png","language":"Rust","readme":"[![Build Status](https://travis-ci.org/zero-sh/apply-user-defaults.svg?branch=master)](https://travis-ci.org/zero-sh/apply-user-defaults)\n![License](https://img.shields.io/crates/l/apply-user-defaults.svg)\n[![Crates.io](https://img.shields.io/crates/v/apply-user-defaults.svg)](https://crates.io/crates/apply-user-defaults)\n\n# apply-user-defaults\n\n`apply-user-defaults` is a small utility to set macOS user defaults\ndeclaratively from a YAML file.\n\n## Usage\n\nTo use, simply structure a YAML file like the following:\n\n```yaml\ncom.apple.dock:\n  # System Preferences \u003e Dock \u003e Automatically hide and show the Dock.\n  autohide: true\n\n  # System Preferences \u003e Dock \u003e Minimize windows using: Scale effect.\n  mineffect: \"scale\"\n\n  # System Preferences \u003e Dock \u003e Show indicators for open applications.\n  show-process-indicators: false\n\n  # System Preferences \u003e Dock \u003e Size.\n  tilesize: 72\n```\n\nThen apply it using:\n\n```sh\n$ apply-user-defaults path-to-file.yaml\n```\n\nYou can also see what commands are being run by enabling verbose output:\n\n```sh\n$ apply-user-defaults path-to-file.yaml --verbose\n==\u003e defaults write com.apple.dock autohide -bool true\n==\u003e defaults write com.apple.dock mineffect -string scale\n==\u003e defaults write com.apple.dock show-process-indicators -bool false\n==\u003e defaults write com.apple.dock tilesize -int 72\nSuccess! Applied defaults.\n```\n\n## Template Expansion\n\nEnvironment variables can also be included using shell parameter expansion\nsyntax. For example:\n\n```yaml\ncom.apple.finder:\n  # Finder \u003e Preferences \u003e New Finder windows show \u003e Home directory.\n  NewWindowTargetPath: \"file://${HOME}\"\n```\n\nwill evaluate to: \n\n```sh\ndefaults write com.apple.finder NewWindowTargetPath -string \"file://$HOME\"\n```\n\nwhere `$HOME` is the value contained in the `HOME` environment variable.\n\nThis only applies when the string in the YAML file begins with a dollar sign and\nis wrapped in braces (just using `$HOME` won't work).\n\nTo disable, you may pass the flag `--no-env` or escape the dollar sign, e.g.\n`'\\\\${VALUE}'`.\n\n## Installation\n\nPre-compiled binaries are available on the [releases\npage](https://github.com/zero-sh/apply-user-defaults/releases).\n\n### Homebrew\n\nIf you're using Homebrew, you can install with a custom tap:\n\n```sh\n$ brew install zero-sh/tap/apply-user-defaults\n```\n\n### Cargo Install\n\nTo install via Cargo, run:\n\n```sh\n$ cargo install apply-user-defaults\n```\n\n### Building from Source\n\nTo build from source:\n\n```sh\n$ git clone https://github.com/zero-sh/apply-user-defaults.git\n$ cd apply-user-defaults\n$ cargo run -- path-to-file.yml --verbose\n```\n\n## License\n\nThis project is licensed under either the [Apache-2.0](LICENSE-APACHE) or\n[MIT](LICENSE-MIT) license, at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-sh%2Fapply-user-defaults","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzero-sh%2Fapply-user-defaults","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzero-sh%2Fapply-user-defaults/lists"}