NOTE: This is currently broken on macOS Sierra.
This is a knock-off of the Mac OS X defaults
program, but able to manipulate nested dicts.
Long-term, I'll likely abandon this project in favor of an Ansible plugin, something like ansible/ansible-modules-extras#2392.
You may need to install PyObjC:
pip install -U pyobjc
To get all the settings for the Basic profile in Terminal:
defaults+ read com.apple.Terminal 'Window Settings.Basic'
To add a setting to that profile (to disable the audible bell feature):
defaults+ write com.apple.Terminal 'Window Settings.Basic.Bell' 0
To read the setting you just wrote:
defaults+ read com.apple.Terminal 'Window Settings.Basic.Bell'
To copy one Terminal profile to another:
defaults+ copy com.apple.Terminal 'Window Settings.Basic' 'Window Settings.Copy of Basic'
defaults+ write com.apple.Terminal 'Window Settings.Copy of Basic.name' 'Copy of Basic'
- Get it to work with macOS Sierra.
- Add
delete
command. - Add
rename
command. - Add other types of items for
write
.- data
- bool, float, etc.
- array, dict
- array-add, dict-add
- with and without flag explicitly specifying type
- Add
read-type
command. - Require a flag to overwrite an array or hash with a single value.
- Handle the case where an intermediate key doesn't exist.
- Accept
-app Terminal
syntax for the domain. - Accept the same
<value_rep>
syntax thatdefaults
does. - Allow specifying the key path separator.
- Do real command-line option parsing and help.
Copyright (c) 2014 Craig Buchek
Copyright (c) 2014 BoochTek, LLC
This software is licensed under the terms of the MIT License. See LICENSE.txt for details.
- Fork it.
- Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin my-new-feature
). - Create new Pull Request.