forked from trq/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·56 lines (47 loc) · 1.74 KB
/
install
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
#!/usr/bin/env zsh
CWD=$(pwd)
SCRIPTPATH=$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)
# Existing zshrc files before installation
if [ -f ~/.zshrc ]; then
mv ~/.zshrc ~/.zshrc.orig
fi
if [ ! -d ~/.config ]; then
mkdir ~/.config
fi
# Create symlinks
ln -sf $SCRIPTPATH/zshrc ~/.zshrc
ln -sf $SCRIPTPATH/zshrc.d ~/.zshrc.d
ln -sf $SCRIPTPATH/bin ~/bin
ln -sf $SCRIPTPATH/git/gitconfig ~/.gitconfig
ln -sf $SCRIPTPATH/git/gitignore_global ~/.gitignore
ln -sf $SCRIPTPATH/alacritty ~/.config/
ln -sf $SCRIPTPATH/tmux ~/.config/
# Setup neovim, eza and other CLI tools
NVIM=1
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Linux detected. Installing nvim and CLI tools.."
# eza
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza bat neovim
snap install ngrok
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "macOS (OSX) detected. Installing nvim.."
brew install neovim eza bat ngrok
else
echo "Unknown operating system."
NVIM=0
fi
# Install powerlevel10k or git pull the latest version
if [ -d ~/.powerlevel10k ]; then
cd ~/.powerlevel10k
git pull
else
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.powerlevel10k
fi
echo 'source ~/.powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc
print "Installation complete. Please restart your terminal. Upon restart, you will be prompted to configure powerlevel10k."
cd $CWD