-
Notifications
You must be signed in to change notification settings - Fork 13
/
install.sh
75 lines (53 loc) · 1.3 KB
/
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
#!/bin/sh
github_mirror="${GITHUB_MIRROR:-'https://ghproxy.com/'}"
fcitx5_themes_dir='fcitx5-themes-main'
target_dir=~/.local/share/fcitx5/themes
download() {
curl "${github_mirror}"https://github.com/thep0y/fcitx5-themes/archive/refs/heads/main.zip -o /tmp/fcitx5-themes.zip
cd /tmp || exit
if [ -d $fcitx5_themes_dir ]; then
rm -rf $fcitx5_themes_dir
fi
unzip fcitx5-themes.zip
cd fcitx5-themes-main || exit
rm README.md
}
update() {
cd /tmp/"$fcitx5_themes_dir" || exit
for f in *; do
rm -rf "$target_dir/$f"
done
}
install() {
cp -r /tmp/"$fcitx5_themes_dir"/* ~/.local/share/fcitx5/themes
}
themes=(spring summer autumn winter green transparent-green)
choice() {
echo "主题列表"
re='^[1-6]$'
for i in "${!themes[@]}";
do
idx=$((i + 1))
echo " $idx: ${themes[i]}"
done
echo -e "\n"
read -p "请输入你要使用的主题序号:" code
if ! [[ $code =~ $re ]]; then
echo "序号不存在"
exit 1
fi
idx=$((code - 1))
theme="${themes[idx]}"
}
theme='spring'
choice
font="思源黑体 13"
config="# 垂直候选列表
Vertical Candidate List=False
# 按屏幕 DPI 使用
PerScreenDPI=True
# Font (设置成你喜欢的字体)
Font=\"$font\"
# 主题(这里要改成你想要使用的主题名,主题名就在下面)
Theme=$theme"
echo "$config"