-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·65 lines (50 loc) · 1.75 KB
/
init.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
# symlinking and setup
# see https://github.com/pearlzli/dotfiles/blob/master/init.sh
# auxiliary utils
if [ -z "$1" ]; then
echo "Run script using ./init.sh path/to/dotfiles/repo${normal}"
exit 1
fi
dotfile_dir=$1
source $dotfile_dir/init_utils.sh
cd $HOME
# create local files
# need to do this first so paths can be edited
for file in ".bashrc-local" ".gitconfig-local"; do
if [ ! -f $file ]; then
touch $file
echo "${green}Created $file${normal}"
fi
done
# symlink dotfiles
for file in ".aliases" ".bashrc" ".gitconfig" ".bash_profile"; do
try_symlink $file
done
# install homebrew, bundle, run Brewfile, symlink
if not_installed brew; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
source ~/.bashrc
brew bundle --file=$1/Brewfile -vd
try_addpath "/Library/TeX/texbin" 0
try_addpath "/opt/homebrew/anaconda3/bin" 1
# try_addpath "$(brew --prefix)/opt/coreutils/libexec/gnubin" 1
# ln -fs /usr/local/bin/exa /usr/local/bin/ls
# symlink folders
ln -s $dotfile_dir/scripts ~/scripts
ln -s $dotfile_dir/Shreddit ~/Shreddit
# fonts
# Fira Mono is a good alternative (and Fire Code has nice ligatures), but I like SF Mono best
cp /System/Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SF-Mono-*.otf ~/Library/Fonts
if [ $? -eq 0 ]; then
echo "${green}Copied SF Mono font files to ~/Library/Fonts${normal}"
else
echo "${red}Could not copy SF Mono font files to ~/Library/Fonts${normal}"
fi
# VS Code
rm -f "/Users/arnavsood/Library/Application Support/Code/User/settings.json"
ln -s $dotfile_dir/settings.json "/Users/arnavsood/Library/Application Support/Code/User/settings.json"
# sudo touch id
sudo ln -fs $dotfile_dir/sudo /etc/pam.d/sudo
# macos
./.macos