Giter Site home page Giter Site logo

aerobounce / defaults.sh Goto Github PK

View Code? Open in Web Editor NEW
30.0 3.0 2.0 74 KB

 User Defaults Plist → Shell Script converter with Regex filtering

License: GNU Affero General Public License v3.0

Shell 100.00%
macos defaults bash-script script dotfiles preferences homebrew plist

defaults.sh's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

netgc sheeley

defaults.sh's Issues

How to use currentHost?

When I use ds save, I see NSGlobalDomain.currentHost.sh, including modifier keys like:

defaults -currentHost write NSGlobalDomain "com.apple.keyboard.modifiermapping.1118-1957-0" '
<array>
	<dict>
		<key>HIDKeyboardModifierMappingDst</key>
		<real>30064771299</real>
		<key>HIDKeyboardModifierMappingSrc</key>
		<real>30064771302</real>
	</dict>
	<dict>
		<key>HIDKeyboardModifierMappingDst</key>
		<integer>30064771303</integer>
		<key>HIDKeyboardModifierMappingSrc</key>
		<integer>30064771298</integer>
	</dict>
	<dict>
		<key>HIDKeyboardModifierMappingDst</key>
		<real>30064771298</real>
		<key>HIDKeyboardModifierMappingSrc</key>
		<real>30064771303</real>
	</dict>
	<dict>
		<key>HIDKeyboardModifierMappingDst</key>
		<integer>30064771302</integer>
		<key>HIDKeyboardModifierMappingSrc</key>
		<real>30064771299</real>
	</dict>
</array>
'

Is there a way to access this directly?
ds -d NSGlobalDomain doesn't include these, and ds doesn't have a -currentHost flag. Anything I'm missing?

Allow/Ignore List for Keys

I'm a big fan of defaults.sh! I converted a number of my plists in git into shell scripts over last weekend.

One of my goals, though, was to stop seeing changes that I don't care about. I was encountering issues where Sparkle, for example, would update a plist value that I don't actually care about.

If I wanted to filter out a single Sparkle entry, I could do something like this, and not have to worry about it

ds com.some.app | grep -v SULastCheckTime

This doesn't necessarily scale well, IMO, and for values that are multi-line, I wouldn't expect it to work at all.

I'm curious whether you'd be open to adding arguments so it would be possible to run

ds com.some.app --ignore 'SU*' --ignore SomeKeyIDoNotCareAbout --allow SUThisIActuallyCareAbout

In my mind, allow would override ignore, and either would accept multiple values. I'd be happy to send a PR if you're interested.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.