-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·42 lines (33 loc) · 1.31 KB
/
setup.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
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
REPOSITORY="https://github.com/linjiX/dotfiles.git"
DOTFILES="$HOME/.config/dotfiles"
while getopts "g" opt; do
case "$opt" in
g) REPOSITORY="[email protected]:linjiX/dotfiles.git" ;;
?) echo "Invalid flag!" && exit 1 ;;
esac
done
set -euo pipefail
set -x
git clone --depth=1 $REPOSITORY "$DOTFILES"
# bash config
echo 'source ~/.config/dotfiles/bash/bashrc' >>~/.bashrc
if [ "$(uname)" == Darwin ]; then
echo '[ -r ~/.bashrc ] && source ~/.bashrc' >>~/.bash_profile
fi
# git config
ln -sf ~/.config/dotfiles/git/gitconfig ~/.gitconfig
# tmux config
git clone --depth=1 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
git clone --depth=1 https://github.com/tmux-plugins/tmux-cpu ~/.tmux/plugins/tmux-cpu
ln -sf ~/.config/dotfiles/tmux/tmux.conf ~/.tmux.conf
# ranger config
git clone --depth=1 https://github.com/alexanderjeurissen/ranger_devicons \
~/.config/ranger/plugins/ranger_devicons
ln -sf ~/.config/dotfiles/ranger/rc.conf ~/.config/ranger/rc.conf
# iterm2 Specify the preferences directory
if [ "$(uname)" == Darwin ]; then
defaults write com.googlecode.iterm2 PrefsCustomFolder -string "$DOTFILES/iterm2/"
defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true
defaults write com.googlecode.iterm2 NoSyncNeverRemindPrefsChangesLostForFile_selection 2
fi