add save-keyboard-shortcuts.sh

This commit is contained in:
Sami Samhuri 2014-12-21 15:41:36 -08:00
parent 486064b79e
commit 4ae843a820

9
save-keyboard-shortcuts.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
# save-keyboard-shortcuts.sh
DESTFILE=~/bin/restore-keyboard-shortcuts.sh
echo '#!/bin/bash' > $DESTFILE
defaults find NSUserKeyEquivalents | sed -e "s/Found [0-9]* keys in domain '\\([^']*\\)':/defaults write \\1 NSUserKeyEquivalents '/" -e "s/ NSUserKeyEquivalents = {//" -e "s/};//" -e "s/}/}'/" >> $DESTFILE
echo killall cfprefsd >> $DESTFILE
chmod a+x $DESTFILE