-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·81 lines (62 loc) · 2.37 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/zsh
# this is the init script for everything in this repo
# this will get the homebrew instalation path:
# copied from homebrew installer: https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
OS="$(uname)"
if [ "$OS" = "Darwin" ]; then
UNAME_MACHINE="$(/usr/bin/uname -m)"
if [ "$UNAME_MACHINE" = "arm64" ]; then
HOMEBREW_PREFIX="/opt/homebrew"
else
HOMEBREW_PREFIX="/usr/local"
fi
elif [ "$OS" = "Linux" ]; then
HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
else
abort "Homebrew is only supported on macOS and Linux."
fi
# install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# set brew path here
brew_path=$HOMEhomebrewBREW_PREFIX/bin
echo $brew_path
# add homebrew to path
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.dotfiles/.zshrc
eval "$($brew_path/brew shellenv)"
source ~/.zshrc
# install all of the apps required
$brew_path/brew bundle --file=~/.dotfiles/Brewfile
# assign fish path to variable
fish_path="$(which fish)"
# set fish as the default shell
sudo bash -c "echo $fish_path >> /etc/shells"
sudo chsh -s $fish_path
# install fisher
$fish_path -c "curl -sL https://git.io/fisher | source & fisher install jorgebucaran/fisher"
# add brew to fish path
$fish_path -c "fish_add_path $brew_path/bin"
# install fish plugins
$fish_path -c "fisher update"
# install nvm, yarn, and global packages
$fish_path -c "nvm install latest"
# install node 16.16.0 for copilot to work on apple sillicon
$fish_path -c "nvm install 16.16.0"
$fish_path -c "nvm use latest"
sudo $fish_path -c "nvm use latest & npm install -g yarn pnpm"
$fish_path -c "nvm use latest & yarn install"
/bin/zsh ~/.dotfiles/scripts/lsp.sh
/bin/zsh ~/.dotfiles/scripts/links.sh
/bin/zsh ~/.dotfiles/scripts/fonts.sh
/bin/zsh ~/.dotfiles/scripts/tools.sh
# terminate the script if the OS is not mac
if [ "$OS" = "Linux" ]; then
exit 1
fi
# setup the iterm config
# specify the preferences directory
defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/.dotfiles/iterm_profile"
# tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true
# width for icons in menu bar
defaults -currentHost write -globalDomain NSStatusItemSpacing -int 10
defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 16