Skip to main content

Command and library to export macOS preferences.

Project description

macprefs

Export and keep track of changes to your preferences.

How to use

usage: prefs-export [-h] [-o OUTPUT_DIRECTORY] [-c]

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY
                        Where to store the exported data
  -c, --commit          Commit the changes with Git

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 -o ~/.config/defaults -c

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

usage: macprefs-install-job [-h] [-o OUTPUT_DIRECTORY]

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY
                        Where to store the exported data

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

macprefs-0.2.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

macprefs-0.2.2-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file macprefs-0.2.2.tar.gz.

File metadata

  • Download URL: macprefs-0.2.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for macprefs-0.2.2.tar.gz
Algorithm Hash digest
SHA256 f2a2f5fa36424681c5b040bdf144b4ea20c1a6ced67dd414c6f9e0a83bb73eb8
MD5 d1b08af21a1868a2e5dccc450a1d7468
BLAKE2b-256 1b48a0ec11063c46ed0662e54afff6e0e75e3567a699799a852772549d10d68e

See more details on using hashes here.

File details

Details for the file macprefs-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: macprefs-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for macprefs-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 006d425314b5cab189c179f2b7e033fc4172aa13608b5ed6bd55a8eba6df0577
MD5 dbe3a898fb521c0d8f6934a6805f3ce2
BLAKE2b-256 d48f3dd034b5fb2b4c218f0ccc8554d29fccfb92a7b539a047e0d6c2790aaed8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page