Command and library to export macOS preferences.
Project description
macprefs
Command and library to export macOS preferences.
Installation
Pip
pip install macprefs
Usage
Usage: prefs-export [OPTIONS]
Export preferences.
Options:
-C, --config FILE Path to the configuration file.
-K, --deploy-key FILE Key for pushing to Git repository.
-c, --commit Commit the changes with Git.
-d, --debug Enable debug logging.
-o, --output-directory DIRECTORY
Where to store the exported data.
-h, --help Show this message and exit.
prefs-export is the main utility. You can export preferences, generate a
~/.macos-like script, and store the
results in a Git repository.
My primary usage is like so:
prefs-export --output-directory ~/.config/defaults --commit
The default output directory is ~/Library/Application Support/macprefs.
Colours can be disabled by setting the environment variable NO_COLOR to a non-empty value.
Configuration
The configuration file is a TOML file. By default prefs-export checks for the path
~/Library/Application Support/macprefs/config.toml. Example file:
# The extend-* options extend the default values used by macprefs.
[tool.macprefs]
extend-ignore-keys = {'domain_name': ['key-to-ignore1', 're:^key-to-ignore']}
extend-ignore-domain-prefixes = ['org.gimp.gimp-']
extend-ignore-domains = ['domain1', 'domain2']
extend-ignore-key-regexes = ['QuickLookPreview_[A-Z0-9-\\.]+']
# Only set these if you want to override the default values used by macprefs.
# ignore-domain-prefixes = []
# ignore-domains = []
# ignore-key-regexes = []
# ignore-keys = {}
deploy-key = '/path/to/deploy-key'
In extend-ignore-keys and ignore-keys, a string value to ignore can be prefixed with re: to
indicate it is a regular expression.
About the generated shell script
A shell script named exec-defaults.sh will exist in the output directory. It may be executed, but
is primarily for copying defaults commands for use in your actual ~/.macos file.
Filtered domains and keys
Certain domains are filtered because they generally do not have anything useful to preserve, such
as com.apple.EmojiCache which only has a cache of Emoji usage data.
Some keys are filtered, as they contain values that change often and are not useful, such as
session IDs and UI state (e.g. QtUi.MainWin(Geometry|State|Pos|Size),
NSStatusItem Preferred Position).
Automated usage
A command macprefs-install-job is included which will install a daily launchd job. The job name is
sh.tat.macprefs.
Usage: macprefs-install-job [OPTIONS]
Job installer.
Options:
-K, --deploy-key FILE Key for pushing to Git repository.
-o, --output-directory DIRECTORY
Where to store the exported data.
--help Show this message and exit.
If the output directory has a .git directory, a commit will be automatically made. Be aware that
files will be added and removed automatically.
To stop this job permanently, run launchctl unload -w ~/Library/LaunchAgents/sh.tat.macprefs.plist.
To uninstall this job, after stopping permanently, delete ~/Library/LaunchAgents/sh.tat.macprefs.plist.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file macprefs-0.4.3.tar.gz.
File metadata
- Download URL: macprefs-0.4.3.tar.gz
- Upload date:
- Size: 29.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64880cb680560c48d539f94b9ce17765e521db63f2fd142793392d065e5ceeb8
|
|
| MD5 |
1f592dc7d973d3ea236565734c9a03c1
|
|
| BLAKE2b-256 |
d51eda83985ba10afca8149ea323d869184971b35fda27c73acb134b6ed7a8a9
|
Provenance
The following attestation bundles were made for macprefs-0.4.3.tar.gz:
Publisher:
publish.yml on Tatsh/macprefs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
macprefs-0.4.3.tar.gz -
Subject digest:
64880cb680560c48d539f94b9ce17765e521db63f2fd142793392d065e5ceeb8 - Sigstore transparency entry: 1393584532
- Sigstore integration time:
-
Permalink:
Tatsh/macprefs@e1c6f44cda18e8d4ca5780752aa9f478867dc248 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/Tatsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1c6f44cda18e8d4ca5780752aa9f478867dc248 -
Trigger Event:
push
-
Statement type:
File details
Details for the file macprefs-0.4.3-py3-none-any.whl.
File metadata
- Download URL: macprefs-0.4.3-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c3baff2c8761f0662e20343004906a5ea30dabb751bda21fe03a87bbc85c54e
|
|
| MD5 |
259b0fef73817028bfb0a699a80b215b
|
|
| BLAKE2b-256 |
b52f13f04264b61585cdd38e948ff9edd5e84a4b6d6eafaf7dd12a3f10ecfc7a
|
Provenance
The following attestation bundles were made for macprefs-0.4.3-py3-none-any.whl:
Publisher:
publish.yml on Tatsh/macprefs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
macprefs-0.4.3-py3-none-any.whl -
Subject digest:
5c3baff2c8761f0662e20343004906a5ea30dabb751bda21fe03a87bbc85c54e - Sigstore transparency entry: 1393584552
- Sigstore integration time:
-
Permalink:
Tatsh/macprefs@e1c6f44cda18e8d4ca5780752aa9f478867dc248 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/Tatsh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e1c6f44cda18e8d4ca5780752aa9f478867dc248 -
Trigger Event:
push
-
Statement type: