-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·120 lines (99 loc) · 3.25 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
if [ ${EUID:-${UID}} = 0 ]; then
read -p "You are now a ROOT USER. OK to install? (y/N): " yn
case "$yn" in [yY]*) ;; *) echo "abort." ; exit ;; esac
fi
if ! command -v git &> /dev/null
then
echo 'Please install git'
exit 1
fi
CYAN='\033[0;34m'
NC='\033[0m'
gui=false
node=false
zinit=false
vimplug=false
for i in "$@" ; do
case "$i" in
'gui' ) gui=true ;;
'node' ) node=true ;;
'zinit' ) zinit=true ;;
'vimplug' ) vimplug=true ;;
'pyenv' ) pyenv=true ;;
esac
done
mkdir -p ~/.cache/vim
mkdir -p ~/.config/fontconfig
mkdir -p ~/.config/systemd/user
mkdir -p ~/.local/share/systemd/user/
mkdir -p ~/.config/tym
# mkdir -p ~/.config/zellij
mkdir -p ~/.go
mkdir -p ~/.local/share/fonts
mkdir -p ~/.ipython/profile_default/startup
mkdir -p ~/.jupyter
mkdir -p ~/.zsh
mkdir -p ~/src
touch ~/.gitconfig_local
touch ~/.zshrc.pre
ln -fs ~/dotfiles/gitconfig ~/.gitconfig
ln -fs ~/dotfiles/gitignore_global ~/.gitignore_global
ln -fs ~/dotfiles/zshrc ~/.zshrc
ln -fs ~/dotfiles/zshenv ~/.zshenv
ln -fs ~/dotfiles/zsh_completions ~/.zsh/completion
# ln -fs ~/dotfiles/bashrc ~/.bashrc
ln -fs ~/dotfiles/tmux.conf ~/.tmux.conf
ln -fs ~/dotfiles/vimrc ~/.vimrc
ln -fsn ~/dotfiles/vim ~/.vim
ln -fsn ~/dotfiles/vim ~/.config/nvim
ln -fs ~/dotfiles/editorconfig ~/.editorconfig
ln -fs ~/dotfiles/tigrc ~/.tigrc
ln -fs ~/dotfiles/pylintrc ~/.pylintrc
ln -fs ~/dotfiles/condarc ~/.condarc
ln -fs ~/dotfiles/systemd/* ~/.local/share/systemd/user/
# ln -fs ~/dotfiles/ipython/startup/* ~/.ipython/profile_default/startup
# ln -fs ~/dotfiles/zellij.kdl ~/.config/zellij/config.kdl
ln -fs ~/dotfiles/latexmkrc ~/.latexmkrc
ln -fs ~/dotfiles/misc/jupyter_lab_config.py ~/.jupyter/
# GUI
if $gui; then
# ln -fs ~/dotfiles/ideavimrc ~/.ideavimrc
ln -fs ~/dotfiles/fonts.conf ~/.config/fontconfig/fonts.conf
ln -fsn ~/dotfiles/fonts ~/.local/share/fonts/dotfiles
mkdir -p ~/.wineprefixes
ln -fs ~/dotfiles/tym/config.lua ~/.config/tym/config.lua
ln -fs ~/dotfiles/tym/local.lua ~/.config/tym/local.lua
# mkdir -p ~/.mpv
# ln -fs ~/dotfiles/mpv.conf ~/.mpv/input.conf
mkdir -p ~/.config/environment.d
ln -fs ~/dotfiles/env.conf ~/.config/environment.d/dotfiles.conf
fi
if $node; then
if [ ! -d ~/.nodebrew ]; then
echo
echo -e "${CYAN}Installing nodebrew${NC}"
curl -L git.io/nodebrew | perl - setup
# node_version=16
# echo -e "${CYAN}Installing node.js ${node_version}${NC}"
# ~/.nodebrew/nodebrew install-binary ${node_version}
else
echo -e "${CYAN}Updating nodebrew${NC}"
~/.nodebrew/nodebrew selfupdate
fi
fi
if $zinit; then
echo -e "${CYAN}Installing zinit${NC}"
mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git"
fi
if $vimplug; then
echo -e "${CYAN}Installing vimplug${NC}"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
fi
if $pyenv; then
echo -e "${CYAN}Installing pyenv${NC}"
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
fi
echo -e "${CYAN}Done.${NC}"