forked from viis/osx-compose-key
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·31 lines (27 loc) · 1005 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·31 lines (27 loc) · 1005 Bytes
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
31
#!/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-elements
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 ~/.config/karabiner/assets/complex_modifications
echo "Copying Karabiner settings..."
cp compose.json ~/.config/karabiner/assets/complex_modifications
# Copy DefaultKeyBinding.dict
mkdir -p ~/Library/KeyBindings
echo "Copying DefaultKeyBinding.dict..."
# use -b option to backup existing file if present
cp -b DefaultKeyBinding.dict ~/Library/KeyBindings/DefaultKeyBinding.dict
echo
echo "Done."