-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanjaro_install.sh
220 lines (197 loc) · 4.31 KB
/
manjaro_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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#!/usr/bin/env bash
# Copyright (C) 2020 pacmanzou <pacmanzou@qq.com>
# Description: An installation script for manjaro-i3 community edition, applies to i3 only
Info() {
printf '[\033[0;34minfo\033[0m] %b\n' "$1"
}
Warn() {
printf '[\033[0;33mwarning\033[0m] %b\n' "$1"
}
Success() {
printf '[\033[0;32msuccess\033[0m] %b\n' "$1"
}
Fail() {
printf '[\033[0;31mfailure\033[0m] %b\n' "$1"
}
LinkHandler() {
if sudo ln -bs "$1" "$2"; then
Success "ln -bs $1 $2"
else
Fail "ln -bs $1 $2"
fi
}
CopyHandler() {
if sudo cp -abr "$1" "$2"; then
Success "cp -abr $1 $2"
else
Fail "cp -abr $1 $2"
fi
}
FileHandler() {
for fileSrc in $1; do
basenameSrc=$(basename "$fileSrc")
if [[ "." == "$basenameSrc" || ".." == "$basenameSrc" ||
"*" == "$basenameSrc" ]]; then
continue
fi
for fileDst in $2; do
basenameDst=$(basename "$fileDst")
dirnameDst=$(dirname "$fileDst")
if [[ "$basenameDst" == "$basenameSrc" ]]; then
sudo mv "$fileDst" "$fileDst"~
fi
done
$3 "$fileSrc" "$dirnameDst"
done
}
file="$HOME/.gitconfig"
if [[ -f "$file" ]]; then
Warn "If you want to run this script, please remove the .gitconfig!"
Fail "Failed to run this script"
exit 1
fi
# Link
Info "### Link to ... ###"
FileHandler "$HOME/dotfiles/link/home/.* $HOME/dotfiles/link/home/*" "$HOME/.* $HOME/*" LinkHandler
FileHandler "$HOME/dotfiles/link/config/*" "$HOME/.config/*" LinkHandler
FileHandler "$HOME/dotfiles/link/bin/*" "/usr/local/bin/*" LinkHandler
echo
# Copy
Info "### Copy to ... ###"
FileHandler "$HOME/dotfiles/copy/home/.* $HOME/dotfiles/copy/home/*" "$HOME/.* $HOME/*" CopyHandler
FileHandler "$HOME/dotfiles/copy/config/*" "$HOME/.config/*" CopyHandler
FileHandler "$HOME/dotfiles/copy/etc/*" "/etc/*" CopyHandler
echo
# Misc
Info "### Misc ###"
if [[ ! -d "$HOME/.config/coc" ]]; then
mkdir "$HOME/.config/coc"
fi
LinkHandler "$HOME/dotfiles/misc/coc/ultisnips" "$HOME/.config/coc"
CopyHandler "$HOME/dotfiles/misc/UPower.conf" "/etc/UPower"
CopyHandler "$HOME/dotfiles/misc/logind.conf" "/etc/systemd"
echo
# Remove
sudo pacman -Rns nano \
manjaro-i3-settings \
palemoon-bin \
xfce4-power-manager \
epdfview \
clipit \
kvantum-manjaro \
gcolor3 \
morc_menu \
mousepad \
volumeicon \
bmenu \
xterm
Info "### Update system ###"
sudo pacman-mirrors -i -c China -m rank
sudo pacman -Syy
sudo pacman -S archlinuxcn-keyring
sudo pacman -Syu
# Install
sudo pacman -S alacritty \
bleachbit \
ctags \
copyq \
cmake \
conky \
dbeaver \
delve \
dunst \
docker \
dmenu-manjaro \
fd \
fzf \
feh \
go \
gopls \
gcc \
gparted \
htop \
java-openjfx \
jdk-openjdk \
jre-openjdk \
kitty \
lightdm-settings \
linux-wifi-hotspot \
lazygit \
lazydocker \
lux-dl \
mpv \
manjaro-settings-manager \
materia-gtk-theme \
music-dl \
neofetch \
nodejs-lts-hydrogen \
npm \
neovim \
neovide \
neomutt \
obs-studio \
pcmanfm \
python-pip \
qbittorrent \
ripgrep \
rar \
scrcpy \
seahorse \
shellcheck \
speedtest-cli \
shfmt \
telegram-desktop \
tldr \
viewnior \
ventoy \
tmux \
tree-sitter-cli \
trash-cli \
ttf-hack \
unzip \
utools \
vnote \
wqy-microhei \
xclip \
yarn \
yay \
zip \
zathura \
zathura-pdf-mupdf
# Bluetooth
sudo pacman -S bluez \
bluez-utils \
blueman
# Input method
sudo pacman -S fcitx5 \
fcitx5-chinese-addons \
fcitx5-configtool \
manjaro-asian-input-support-fcitx5
# Virtual machine
# sudo pacman -S qemu \
# libvirt \
# ovmf \
# virt-manager \
# virt-viewer \
# vde2
# Remove again
sudo pacman -Rns nitrogen
Info "### Pip install ###"
pip install black \
mycli \
pynvim
echo
Info "### Npm install ###"
sudo npm install -g json-server \
reveal-md
echo
# Delete
trash-put "$HOME/.config/hexchat" \
"$HOME/.config/falkon" \
"$HOME/.config/clipit" \
"$HOME/.config/epdfview" \
"$HOME/.config/morc_menu" \
"$HOME/.config/xfce4" \
"$HOME/.config/Kvantum" \
"$HOME/.config/volumeicon" \
"$HOME/.config/nitrogen"