macprefs

Command and library to export macOS preferences.

https://github.com/tatsh/macprefs

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary

Keywords

command-line macos preferences utilities

Keywords from Contributors

interactive mesh interpretability profiles optics sequences generic projection optim embedded
Last synced: 4 months ago · JSON representation ·

Repository

Command and library to export macOS preferences.

Basic Info
Statistics
  • Stars: 29
  • Watchers: 3
  • Forks: 2
  • Open Issues: 0
  • Releases: 10
Topics
command-line macos preferences utilities
Created over 5 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing Funding License Citation Codeowners Security

README.md

macprefs

Python versions PyPI - Version GitHub tag (with filter) License GitHub commits since latest release (by SemVer including pre-releases) CodeQL QA Tests Coverage Status Documentation Status mypy pre-commit pydocstyle pytest Ruff Downloads Stargazers

@Tatsh Mastodon Follow

Command and library to export macOS preferences.

Installation

Pip

shell pip install macprefs

Usage

```plain 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:

shell 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:

```toml

The extend-* options extend the default values used by macprefs.

[tool.macprefs] extend-ignore-keys = {'domainname': ['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 often changing and non-useful values 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

```plain 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.

Owner

  • Login: Tatsh
  • Kind: user

Citation (CITATION.cff)

authors:
  - family-names: 'Udvare'
    given-names: 'Andrew'
cff-version: '1.2.0'
date-released: '2025-05-04'
message: 'If you use this software, please cite it as below.'
title: 'macprefs'
version: '0.4.1'

GitHub Events

Total
  • Issues event: 1
  • Watch event: 7
  • Delete event: 117
  • Issue comment event: 90
  • Push event: 175
  • Pull request event: 239
  • Fork event: 1
  • Create event: 128
Last Year
  • Issues event: 1
  • Watch event: 7
  • Delete event: 117
  • Issue comment event: 90
  • Push event: 175
  • Pull request event: 239
  • Fork event: 1
  • Create event: 128

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 177
  • Total Committers: 5
  • Avg Commits per committer: 35.4
  • Development Distribution Score (DDS): 0.497
Past Year
  • Commits: 118
  • Committers: 4
  • Avg Commits per committer: 29.5
  • Development Distribution Score (DDS): 0.449
Top Committers
Name Email Commits
Andrew Udvare a****e@g****m 89
dependabot[bot] 4****] 65
Andrew Udvare a****d@d****m 15
Tatsh T****h 5
Andrew Udvare a****e@r****m 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 4
  • Total pull requests: 426
  • Average time to close issues: 7 months
  • Average time to close pull requests: about 15 hours
  • Total issue authors: 3
  • Total pull request authors: 1
  • Average comments per issue: 3.5
  • Average comments per pull request: 0.66
  • Merged pull requests: 395
  • Bot issues: 0
  • Bot pull requests: 426
Past Year
  • Issues: 0
  • Pull requests: 250
  • Average time to close issues: N/A
  • Average time to close pull requests: about 12 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.58
  • Merged pull requests: 221
  • Bot issues: 0
  • Bot pull requests: 250
Top Authors
Issue Authors
  • Bobronium (2)
  • Tatsh (1)
  • Bellavene (1)
Pull Request Authors
  • dependabot[bot] (596)
Top Labels
Issue Labels
stale (1)
Pull Request Labels
dependencies (596) python (425) javascript (170) github_actions (1)

Dependencies

.github/workflows/close-inactive.yml actions
  • actions/stale v5 composite
.github/workflows/qa.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
package.json npm
  • cspell ^7.3.7 development
  • markdownlint-cli2 ^0.10.0 development
  • prettier ^2.8.7 development
  • prettier-plugin-ini ^1.1.0 development
  • prettier-plugin-sort-json ^2.0.0 development
  • prettier-plugin-toml ^0.4.0 development
yarn.lock npm
  • 209 dependencies
.rtfd-requirements.txt pypi
  • sphinx-click >=4.4.0
  • tomlkit >=0.12.1
poetry.lock pypi
  • alabaster 0.7.13
  • appdirs 1.4.4
  • argcomplete 3.1.2
  • attrs 23.1.0
  • babel 2.12.1
  • cattrs 23.1.2
  • certifi 2023.7.22
  • charset-normalizer 3.3.0
  • click 8.1.7
  • colorama 0.4.6
  • commitizen 3.10.0
  • coverage 6.5.0
  • coveralls 3.3.1
  • decli 0.6.1
  • deepdiff 6.5.0
  • doc8 1.1.1
  • docopt 0.6.2
  • docutils 0.20.1
  • esbonio 0.16.1
  • exceptiongroup 1.1.3
  • idna 3.4
  • imagesize 1.4.1
  • importlib-metadata 6.8.0
  • iniconfig 2.0.0
  • isort 5.12.0
  • jinja2 3.1.2
  • loguru 0.7.2
  • lsprotocol 2023.0.0b1
  • markupsafe 2.1.3
  • mock 5.1.0
  • mypy 1.5.1
  • mypy-extensions 1.0.0
  • ordered-set 4.1.0
  • packaging 23.1
  • pbr 5.11.1
  • platformdirs 3.10.0
  • pluggy 1.3.0
  • prompt-toolkit 3.0.36
  • pygls 1.0.2
  • pygments 2.16.1
  • pyspellchecker 0.7.2
  • pytest 7.4.2
  • pytest-asyncio 0.21.1
  • pytest-cov 4.1.0
  • pytest-mock 3.11.1
  • pytoolconfig 1.2.5
  • pyyaml 6.0.1
  • questionary 2.0.1
  • requests 2.31.0
  • restructuredtext-lint 1.4.0
  • rope 1.10.0
  • ruff 0.0.291
  • snowballstemmer 2.2.0
  • sphinx 7.2.6
  • sphinx-click 5.0.1
  • sphinxcontrib-applehelp 1.0.7
  • sphinxcontrib-devhelp 1.0.5
  • sphinxcontrib-htmlhelp 2.0.4
  • sphinxcontrib-jsmath 1.0.1
  • sphinxcontrib-qthelp 1.0.6
  • sphinxcontrib-serializinghtml 1.1.9
  • stevedore 5.1.0
  • termcolor 2.3.0
  • tomli 2.0.1
  • tomlkit 0.12.1
  • typeguard 3.0.2
  • types-mock 5.1.0.2
  • typing-extensions 4.8.0
  • urllib3 2.0.5
  • wcwidth 0.2.8
  • win32-setctime 1.1.0
  • yapf 0.40.2
  • zipp 3.17.0
pyproject.toml pypi
  • click ^8.1.7
  • loguru ^0.7.2
  • python >=3.10,<4