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.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: macprefs-0.2.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for macprefs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 70c4dc6aab01cbb2b5fae91307f65b8824a318f32e38d898400be8142219718d
MD5 9c106442a638c18f194d2a9ef302b85d
BLAKE2b-256 ca6b7a97385ffd3d523c67eb875e1d54b829dcb1de3a30316605aa41379a7dfe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: macprefs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for macprefs-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e5250788e469ed454154fa163ab9da743614d5739e7ab01de2b0d5d261cb302
MD5 3bb816fdea6bed31f70d8cc9d093a58a
BLAKE2b-256 05b8c6d778216e7739d6fcdfd685865ef4426d72920cbeb8cac6b9a5f96efdf5

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