-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
89 lines (72 loc) · 2.6 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
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
#!/bin/zsh
# Install Zsh if it isn't already the default shell
if [[ $SHELL != *"zsh"* ]]; then
echo "Zsh is not the default shell. Installing Zsh..."
brew install zsh
chsh -s $(which zsh)
fi
# Install Oh My Zsh if it isn't already installed
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo "Oh My Zsh is not installed. Installing Oh My Zsh..."
RUNZSH=no CHSH=no sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
# Set the Zsh theme to agnoster if it isn't already set
ZSH_THEME=$(grep 'ZSH_THEME=' $HOME/.zshrc | sed -e 's/ZSH_THEME="//' -e 's/"$//')
if [ "$ZSH_THEME" != "agnoster" ]; then
echo "Setting Zsh theme to agnoster..."
sed -i '' 's/^ZSH_THEME=.*/ZSH_THEME="agnoster"/' $HOME/.zshrc
fi
# Install Powerline fonts
echo "Installing Powerline fonts..."
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts
# Instructions for the user to manually set the font in their terminal
echo "Please manually set one of the installed Powerline fonts in your terminal emulator's settings to take full effect."
# Install Oh My Zsh plugins
ZSH_CUSTOM=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}
if [ ! -d "${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting" ]; then
echo "Installing zsh-syntax-highlighting..."
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting
fi
if [ ! -d "${ZSH_CUSTOM}/plugins/zsh-autosuggestions" ]; then
echo "Installing zsh-autosuggestions..."
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM}/plugins/zsh-autosuggestions
fi
# Add plugins to .zshrc if they aren't already there
if ! grep -q 'zsh-syntax-highlighting' $HOME/.zshrc; then
sed -i '' '/^plugins=(git)/a\
plugins+=(zsh-syntax-highlighting)
' $HOME/.zshrc
fi
if ! grep -q 'zsh-autosuggestions' $HOME/.zshrc; then
sed -i '' '/^plugins=(git)/a\
plugins+=(zsh-autosuggestions)
' $HOME/.zshrc
fi
echo "Installing Arc, Around, 1Password"
brew install arc
brew install around
brew install 1password
# Install fnm, node, and pnpm
echo "Installing Docker"
brew install --cask docker
# Install fnm, node, and pnpm
echo "Installing fnm and pnpm"
brew install fnm
echo 'eval "$(fnm env --use-on-cd)"' >> $HOME/.zshrc
fnm install --latest
brew install pnpm
# Add aliases
echo "Adding aliases"
echo 'alias p=pnpm' >> $HOME/.zshrc
echo 'alias ms="/bin/bash ~/Scripts/makeswift.sh"' >> $HOME/.zshrc
# Reload shell
source $HOME/.zshrc
# Install Visual Studio Code
echo "Installing Visual Studio Code..."
brew install --cask visual-studio-code
# Final message to the user
echo "Installation complete!"