-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·53 lines (46 loc) · 1.59 KB
/
start.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
#!/usr/bin/env bash
# shellcheck disable=SC1091,SC2002,SC2094
SH_NAME=$(basename "${SHELL:-/bin/zsh}")
## Functions
install_deps() {
sudo apt-get update -qq
sudo apt-get install -qqy vim ruby-dev curl fuse make
sudo gem install colorls
}
install_omz() {
if [ -f "${HOME}/.dotfiles/.zshrc" ] && [ ! -f "${HOME}/.dotfiles/.bashrc" ]; then
sudo usermod --shell /usr/bin/zsh "$(whoami)"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi
}
install_nvim() {
[[ ! -d "${HOME}/.config" ]] && mkdir -p "${HOME}/.config"
if [ -f "${HOME}/.dotfiles/nvim.sh" ]; then
source "${HOME}/.dotfiles/nvim.sh" "${NVIM_REPO}"
else
git clone "${NVIM_REPO}" "${HOME}/.config/nvim"
fi
}
link_configs() {
if [ "${SH_NAME}" == "zsh" ]; then
ln -sf "${HOME}/.dotfiles/dracula-pro.zsh-theme" "${HOME}/.oh-my-zsh/themes/dracula-pro.zsh-theme"
ln -sf "${HOME}/.dotfiles/.p10k.zsh" "${HOME}/.p10k.zsh"
fi
ln -sf "${HOME}/.dotfiles/colorls" "${HOME}/.config/colorls"
ln -sf "${HOME}/.dotfiles/kitty" "${HOME}/.config/kitty"
ln -sf "${HOME}/.dotfiles/fzf-git.sh" "${HOME}/fzf-git.sh"
}
setup_shell() {
if [ -f "${HOME}/.dotfiles/.${SH_NAME}rc" ]; then
ln -sf "${HOME}/.dotfiles/aliases" "${HOME}/.${SH_NAME}_aliases"
ln -sf "${HOME}/.dotfiles/envs" "${HOME}/.${SH_NAME}_envs"
ln -sf "${HOME}/.dotfiles/.${SH_NAME}rc" "${HOME}/.${SH_NAME}rc"
fi
}
## Main
sudo chown -R "$(whoami):$(whoami)" ./
install_deps
install_omz
# install_nvim
link_configs
setup_shell