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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: macprefs-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a324592adc128156a361f67a059f32f696c23c635964e6a57177a9fe0a4a69ad
MD5 69e422b211c1e8048723b8ba6c33f785
BLAKE2b-256 e3ef0aeee67e1008d5d1ef51b13b36551bd622da4b2d74bac91b7b8a8a8dbc7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: macprefs-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57b469e1401d579eb326e9bee4bb77c257a9c4d29d3aed3cdefba8ce442de043
MD5 39f05a03ef8fa61f13460eba235be1db
BLAKE2b-256 c83358b9fb12927c0050b93cf59dffe317617f620cd11f4874d622a3a18d662a

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