-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.sh
executable file
·128 lines (95 loc) · 4.28 KB
/
main.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/sh
echo "Starting setup script. Continue (yes/no)?"
while True; do
read answer
if [ "$answer" == "yes" ]; then
echo "Starting setup now."; break;
elif [ "$answer" == "no" ]; then
echo "Exiting."; exit;
else
echo "Please enter yes or no."
fi
done
echo "-----------------------------------------------------------------------"
echo ":: Installing xcode command line tools ::"
xcode-select --install
echo "-----------------------------------------------------------------------"
echo ":: Installing homebrew ::"
if test ! $(which brew); then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo " Running brew update ..."
brew update
echo " Install brews via brew bundle from Brewfile ..."
brew tap homebrew/bundle
brew bundle --file=./homebrew/Brewfile
echo " Cleaning up brew binaries and cache to free disk space ..."
brew cask cleanup
rm -rf $(brew --cache)
echo "-----------------------------------------------------------------------"
echo ":: Linking Dropbox and Google Drive to home folder ::"
if [ ! -d "${HOME}/Dropbox" ]; then
echo "No Dropbox folder found in home. Linking /Volumes/nifty/Dropbox."
ln -s /Volumes/nifty/Dropbox ${HOME}
fi
if [ ! -d "${HOME}/Google Drive" ]; then
echo "No Google Drive folder found in home. Linking /Volumes/nifty/Google\ Drive."
ln -s /Volumes/nifty/Google\ Drive ${HOME}
fi
echo "-----------------------------------------------------------------------"
echo ":: Stowing dotfiles to home folder ::"
for d in `ls ./dotfiles`; do
stow --dir=dotfiles --target=${HOME} -v $d
done # Unstow with -vD option
echo"Local .profile get's unstowed and copied instead"
rm ${HOME}.profile_local
cp "./dotfiles/profile/.profile_local" ${HOME}
echo "-----------------------------------------------------------------------"
echo ":: Stowing sublime text 3 settings to packages folder ::"
TARGET="${HOME}/Library/Application Support/Sublime Text 3/Packages/User"
mkdir -p "$TARGET"
stow --target="$TARGET" -v sublimetext3
echo "Manually cloning LaTeX-cwl files to ST3 packages folder"
git clone https://github.com/LaTeXing/LaTeX-cwl.git "$TARGET"/LaTeX-cwl
echo "-----------------------------------------------------------------------"
echo ":: Setting up tmux ::"
# Note: https://github.com/arcticicestudio/nord-terminal-app is needed and a
# powerline font to look good (Hack from brew)
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
tmux source .tmux.conf
echo "-----------------------------------------------------------------------"
echo ":: Setting up neovim ::"
echo " Unstow nvim to prevent symlinking the whole plugged folder"
stow --dir=dotfiles --target=${HOME} -vD nvim
echo " Install vim plug"
curl -fLo ${HOME}/.config/nvim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo " Restow to install plugs from init.vim"
stow --dir=dotfiles --target=${HOME} -v nvim
echo " Install plugs from init.vim via Vim-Plug"
nvim -c PlugInstall -c qall
echo "-----------------------------------------------------------------------"
echo ":: Setting up OSX python ::"
chmod 744 ./osx/python.sh
./osx/python.sh
echo "-----------------------------------------------------------------------"
echo ":: Setting up homebrews python3 ::"
chmod 744 ./homebrew/python3.sh
./homebrew/python3.sh
echo "-----------------------------------------------------------------------"
echo ":: Update and setup MacTex ::"
echo " Use new /etc/paths.d/TeX paths without starting a new terminal ..."
eval `/usr/libexec/path_helper -s`
echo " Set some MacTe X settings ..."
sudo tlmgr option autobackup -- -1
sudo tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet
echo " Update MacTeX ..."
sudo tlmgr update --self --all --reinstall-forcibly-removed
echo "-----------------------------------------------------------------------"
echo ":: Install new dictionaries for Sublime Text 3"
git clone https://github.com/titoBouzout/Dictionaries.git ${HOME}/Library/Application\ Support/Sublime\ Text\ 3/Packages/Dictionaries/
## Set OS X preferences
# We will run this last because this will reload the shell
# source ./osx/osx.sh
echo "#######################################################################"
echo "Done. Restart the terminal and you're ready to go."