-
Notifications
You must be signed in to change notification settings - Fork 5
/
deploy-mac.sh
executable file
·25 lines (21 loc) · 1.01 KB
/
deploy-mac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash -
#=============================================================================
# Deploy settings
#
# by Ming Chen, [email protected]
#=============================================================================
set -o nounset # treat unset variables as an error
set -o errexit # stop script if command fail
export PATH="/bin:/usr/bin:/sbin"
IFS=$' \t\n' # reset IFS
unset -f unalias # make sure unalias is not a function
\unalias -a # unset all aliases
ulimit -H -c 0 -- # disable core dump
hash -r # clear the command path hash
direction="${1:-restore}"
KarabinerPrivate="${HOME}/Library/Application Support/Karabiner/private.xml"
if [[ ${direction} == 'restore' ]]; then
cp karabiner-private.xml "${KarabinerPrivate}"
elif [[ ${direction} == 'save' ]]; then
cp "${KarabinerPrivate}" karabiner-private.xml
fi