forked from gnarf/osx-compose-key
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·30 lines (26 loc) · 937 Bytes
/
install.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
26
27
28
29
30
#!/usr/bin/env bash
# Install Karabiner if it isn't installed, but homebrew and cask are.
if [[ "$(type -P brew)" && "$(brew ls --versions brew-cask)" ]]; then
if [[ ! "$(brew cask list 2>/dev/null | grep karabiner)" ]]; then
echo "Installing Karabiner..."
brew cask install karabiner
fi
else
echo "Homebrew and Homebrew Cask not detected. Not installing Karabiner."
echo "If you intended for this script to install Karabiner, install Homebrew"
echo "and Homebrew Cask:"
echo
echo "http://brew.sh/"
echo "http://caskroom.io/"
echo
fi
# Copy Karabiner settings.
mkdir -p ~/Library/Application\ Support/Karabiner
echo "Copying Karabiner settings..."
cp private.xml ~/Library/Application\ Support/Karabiner/private.xml
# Copy DefaultKeyBinding.diet
mkdir -p ~/Library/KeyBindings
echo "Copying DefaultKeyBinding.dict..."
cp DefaultKeyBinding.dict ~/Library/KeyBindings/DefaultKeyBinding.dict
echo
echo "Done."