-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·62 lines (55 loc) · 1.11 KB
/
update.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
#!/usr/bin/env bash
remove_file() {
local dir=$1
for file in "$dir"/*; do
if [[ -f "$file" && "$file" =~ \.uuid$ ]]; then
rm "$file"
elif [[ -d "$file" ]]; then
remove_file "$file"
fi
done
}
update_up() {
cp -rp ~/.config/Kvantum \
~/.config/dunst \
~/.config/fcitx5 \
~/.config/fish \
~/.config/fontconfig \
~/.config/gtk-* \
~/.config/i3 \
~/.config/kitty \
~/.config/neofetch \
~/.config/picom \
~/.config/polybar \
~/.config/qt6ct \
~/.config/ranger \
~/.config/rofi \
~/.config/starship.toml \
~/.config/tmux \
~/.config/vim \
~/.config/yazi \
~/.config/zsh \
./config
cp ~/.xinitrc \
~/.Xresources \
./user
cp -rp ~/.local/share/fcitx5 \
~/.local/share/fonts \
~/.local/share/themes \
./local
shopt -s dotglob
rm -rf ./local/fcitx5/pinyin ./local/fonts/artfont
remove_file ./local
echo -e "\e[31mupdate completed\e[0m"
}
update_down() {
cp -rf ./config/. "$HOME"/.config
cp -rf ./local/. "$HOME"/.local/share
cp -rf ./user/. "$HOME"/
echo -e "\e[31mupdate completed\e[0m"
}
case "$1" in
up) update_up ;;
down) update_down ;;
*) update_up ;;
esac