dotfiles/install

52 lines
2 KiB
Bash
Executable file

#!/usr/bin/env bash
if [ -z "$HOME" ]; then echo "Seems you don't have a \$HOME :("; exit 1; fi
DOTFILES=$HOME/.dotfiles
cd $HOME
rm -rf $DOTFILES
mkdir $DOTFILES
cd $DOTFILES
git init
git remote add origin git@github.com:joshtronic/dotfiles.git
git pull origin master
git submodule update --init --recursive
rm -rf $HOME/.gemrc $HOME/.gitconfig $HOME/.grcat $HOME/.my.cnf \
$HOME/.tmux.conf $HOME/.tmuxinator $HOME/.vim $HOME/.zshrc
ln -s $DOTFILES/gemrc $HOME/.gemrc
ln -s $DOTFILES/gitconfig $HOME/.gitconfig
ln -s $DOTFILES/vendor/nitso/colour-mysql-console/.grcat $HOME/.grcat
ln -s $DOTFILES/my.cnf $HOME/.my.cnf
ln -s $DOTFILES/tmux.conf $HOME/.tmux.conf
ln -s $DOTFILES/tmuxinator $HOME/.tmuxinator
ln -s $DOTFILES/vim $HOME/.vim
ln -s $DOTFILES/zshrc $HOME/.zshrc
if [[ `uname` == 'Darwin' ]]; then
rm -rf $HOME/Library/Application\ Support/Karabiner
ln -s $DOTFILES/Karabiner $HOME/Library/Application\ Support/Karabiner
/Applications/Karabiner.app/Contents/Library/bin/karabiner reloadxml
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommand
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommandH
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommandJ
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommandK
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommandL
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommand1
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommand2
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommand3
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommand4
/Applications/Karabiner.app/Contents/Library/bin/karabiner enable rightCommand5
defaults write com.apple.dock autohide-delay -float 86400; killall Dock
defaults write -g ApplePressAndHoldEnabled -bool false
fi
cd $HOME
rm -f $HOME/.zcompdump*
exec zsh