macOS defaults(1) command generator
Project description
Prefsniff
Author: Zachary Cutlip, uid000 at gmail
prefsniff
is a utility to watch macOS plist files for changes, and then autogenerate the defaults
command to apply those changes. Its intended use is to have prefsniff
watch a plist file while setting a system or application preference. The resulting defaults command can then be added to a shell script or incorporated into a configuration management system such as Ansible.
Installing
$ git clone <repo url> prefsniff
$ cd prefsniff
$ pip install -r ./requirements.txt
Using
prefsniff
has two modes of operation; directory mode and file mode.
- Directory mode: watch a directory (non-recursively) for plist files that are unlinked and replaced in order to observe what file backs a particular configuration setting.
- File mode: watch a plist file in order to represent its changes as one or more
defaults
command.
Directory mode example:
$ prefsniff ~/Library/Preferences
PREFSNIFF version 0.1.0b3
Watching directory: /Users/zach/Library/Preferences
Detected change: [deleted] /Users/zach/Library/Preferences/com.apple.dock.plist
Detected change: [created] /Users/zach/Library/Preferences/com.apple.dock.plist
File mode example:
$ prefsniff ~/Library/Preferences/com.apple.dock.plist
PREFSNIFF version 0.1.0b3
Watching prefs file: /Users/zach/Library/Preferences/com.apple.dock.plist
*****************************
defaults write com.apple.dock orientation -string right
*****************************
TODO
- Implement
data
anddate
plist types - Clean up output so that it can be redirected to a shell script or similar
- Add additional output options (such as the name of a shell script to create)
- Split utility & API
- Make prefsniff into a python module that exports API
- Make a separate
prefsniff
command-line utility that uses the API
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
prefsniff-0.2.1.tar.gz
(9.8 kB
view hashes)
Built Distribution
prefsniff-0.2.1-py3-none-any.whl
(11.3 kB
view hashes)
Close
Hashes for prefsniff-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b221c20c35b42bc3c0b72cc83e9c1ec4332d967667863506fc386ccb5082317 |
|
MD5 | 9c67279bab3ca6a5d52a80f6f2ce1cef |
|
BLAKE2b-256 | f2693c4efba8458a059bd0b05e65b69e201dd0e9474410047eebf4891a4adb77 |