Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

canhaz

macrumors 6502
Original poster
Jan 17, 2012
310
145
Hey folks

So what I would love to be able to do is not have to remember to manually setup custom keys using the GUI, on a new install eg:

Lo4amd5.png


But instead include custom keyboard mappings as part of my bootstrap bash script, that set's up any fresh OSX install has all my preferences and defaults in scriptable format. (I use brew and cask to install sw).

eg.
Code:
	# opening and closing windows and popovers
	defaults write -g NSAutomaticWindowAnimationsEnabled -bool false

	# smooth scrolling
	defaults write -g NSScrollAnimationEnabled -bool false

and for exports

Code:
# Make sublime the default editor
export EDITOR="subl"

# Don’t clear the screen after quitting a manual page
export MANPAGER="less -X"

# Highlight section titles in manual pages
export LESS_TERMCAP_md="$ORANGE"

etc.

Does anyone know if this is possible?
 

benwiggy

macrumors 68020
Jun 15, 2012
2,382
201
Keyboard shortcuts are held in .plist files like most other preferences. I think it's com.apple.symbolichotkeys.plist.

It should be possible to use the defaults command to add them -- although some nested xml structures are beyond what defaults can cope with.

How often do you need to reinstall the OS without restoring your user settings? Maybe there's an easier way of doing what you're trying to achieve by doing that, which doesn't include losing all your user prefs.
 

canhaz

macrumors 6502
Original poster
Jan 17, 2012
310
145
Keyboard shortcuts are held in .plist files like most other preferences. I think it's com.apple.symbolichotkeys.plist.

It should be possible to use the defaults command to add them -- although some nested xml structures are beyond what defaults can cope with.

How often do you need to reinstall the OS without restoring your user settings? Maybe there's an easier way of doing what you're trying to achieve by doing that, which doesn't include losing all your user prefs.

Thanks, I'll try that.

To answer your question. I hardly ever reinstall, it's more a principle issue. If I made a customization, I'd like to record that in a standardized format.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.