-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·103 lines (83 loc) · 2.92 KB
/
install.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
#!/usr/bin/env bash
# NOTE: *SHOULD* be safe to run multiple times
# Assumes dotfiles is in $HOME
# git clone [email protected]:BluSyn/dotfiles.git ~/dotfiles
# Install brew/pacman pkgs depending on OS
# Supported OS: MacOS (brew) and Arch Linux (pacman)
SHARED_PKGS=("openssl" "wget" "curl" "unzip" "ripgrep" "fish" "starship" "tmux" "tmuxp" "helix" "bat" "htop" "rustup")
PACMAN_PKGS=("neovim")
BREW_PKGS=("nvim")
echo -n "Installing default packages..."
if [[ $OSTYPE == 'darwin'* ]]; then
if ! command -v brew &> /dev/null
then
echo "❌"
echo "Homebrew not found. Go to https://brew.sh"
exit 1
fi
brew install ${SHARED_PKGS[@]} ${BREW_PKGS[@]}
elif [[ $OSTYPE == 'linux'* ]]; then
if ! command -v pacman &> /dev/null
then
echo "❌"
echo "Pacman not found. Only Arch Linux supported"
exit 1
fi
sudo pacman -Sy --needed ${SHARED_PKGS[@]} ${PACMAN_PKGS[@]}
fi
if [ $? -ne 0 ]; then
echo "❌"
echo "Failed to install packages!"
exit 1
fi
echo "✔︎"
echo -n "Git Submodules... "
git submodule update --init --recursive
echo "✔︎"
# ln command has different options on MacOS/Linux
link() {
if [[ $OSTYPE == 'darwin'* ]]; then
ln -sfh $1 $2
elif [[ $OSTYPE == 'linux'* ]]; then
ln -sfT $1 $2
fi
}
echo -n "Installing Configs..."
link $HOME/dotfiles/bash/bashrc $HOME/.bashrc
link $HOME/dotfiles/bash/profile $HOME/.profile
link $HOME/dotfiles/bash/bashTweaks $HOME/.bashTweaks
link $HOME/dotfiles/git $HOME/.config/git
link $HOME/dotfiles/tmux $HOME/.config/tmux
link $HOME/dotfiles/tmuxp $HOME/.config/tmuxp
link $HOME/dotfiles/nvim $HOME/.config/nvim
link $HOME/dotfiles/helix $HOME/.config/helix
link $HOME/dotfiles/alacritty $HOME/.config/alacritty
link $HOME/dotfiles/wezterm $HOME/.config/wezterm
link $HOME/dotfiles/aerospace $HOME/.config/aerospace
link $HOME/dotfiles/starship/starship.toml $HOME/.config/starship.toml
# Frequently htop dir already exists, just link config
mkdir $HOME/.config/htop
link $HOME/dotfiles/htop/htoprc $HOME/.config/htop/htoprc
# config only, don't mount DIR as fish adds untracked files here
mkdir $HOME/.config/fish
link $HOME/dotfiles/fish/config.fish $HOME/.config/fish/config.fish
echo "✔︎"
# Install latest rust stable
echo -n "Installing Rust... "
rustup default stable
echo "✔︎"
# Install Nerd Font
# https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/DejaVuSansMono
echo -n "Installing Nerd Font... "
wget -P /tmp/ https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/DejaVuSansMono.tar.xz
if [[ $OSTYPE == 'darwin'* ]]; then
FONTDIR="${HOME}/Library/Fonts"
tar -xvf /tmp/DejaVuSansMono.tar.xz -C ${FONTDIR} '*.ttf'
elif [[ $OSTYPE == 'linux'* ]]; then
FONTDIR="${HOME}/.local/share/fonts/"
mkdir -p ${FONTDIR}
tar -xvf /tmp/DejaVuSansMono.tar.xz -C ${FONTDIR} --wildcards '*.ttf'
fi
rm /tmp/DejaVuSansMono.tar.xz
echo "✔︎"
echo "Installation Complete ✔︎"