-
Notifications
You must be signed in to change notification settings - Fork 0
/
gohome.sh
executable file
·82 lines (61 loc) · 1.34 KB
/
gohome.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
QB='E -n "\033[34m(y/n) \033[0m"; read -k1 Q; if [[ $Q =~ [Yy] ]]; then E;'
QE='else E "\n\033[34m^\033[0m"; fi'
zsh << SHELL
E() {
echo \$*
}
EE() {
echo -n "\033[32m"
E \$*
echo -n "\033[0m"
}
cd ~/_
EE "# Checking CLI config"
[[ -n "$GHPROXY" ]] && {
E " * Using <ghproxy.com>."
export _GOHOME_GITHUB_PREFIX="https://ghproxy.com/"
}
[[ -n "$PROXYCMD" ]] && {
E " * Using proxy command '$PROXYCMD'."
export _PROXY_PREFIX="$PROXYCMD "
}
EE "# Constructing dirctories"
mkdir -p ~/{src,bin,res}
EE "# Linking dotfiles"
for f in .zshrc .gitconfig; do
rm -f ~/\$f
ln -s ~/_/\$f ~/\$f
E " * \$f"
done
EE "# Sourcing .zshrc"
source .zshrc
EE "# Installing oh-my-zsh?"
$QB
E " * omz"
if [[ ! -d $ZSH ]]; then
${_PROXY_PREFIX}git clone "${_GOHOME_GITHUB_PREFIX}https://github.com/robbyrussell/oh-my-zsh.git" $ZSH
else
E " (skipped)"
fi
cd $ZSH/custom/plugins
E " * plugin: zsh-syntax-highlighting"
${_PROXY_PREFIX}git clone "${_GOHOME_GITHUB_PREFIX}https://github.com/zsh-users/zsh-syntax-highlighting.git"
cd ~/_
$QE
EE "# Calling Fcitx5?"
$QB
_GOHOME_INDENT=1 zsh ./fcitx5/gohome.sh 1
cd ~/_
$QE
EE "# Initializing submodules?"
$QB
${_PROXY_PREFIX}git submodule update --init --recursive
$QE
EE "# Calling Vim?"
$QB
_GOHOME_INDENT=1 zsh ./FkVim/gohome.sh 1
cd ~/_
$QE
EE "# Welcoming Main"
rehash
SHELL