Add instalation script for rime-cantonese support.
This commit is contained in:
parent
3bffa00e0a
commit
35842c95e7
21
.config/scripts/fcitx/install-rime-cantonese.sh
Executable file
21
.config/scripts/fcitx/install-rime-cantonese.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Script to install rime-cantonese based on https://github.com/rime/rime-cantonese/wiki/FreeBSD-%E5%AE%89%E8%A3%9D%E6%95%99%E7%A8%8B
|
||||
rimedir="$HOME/.local/share/fcitx5/rime"
|
||||
clonedir="$rimedir/repos"
|
||||
|
||||
if [[ "$1" == "uninstall" ]] || [[ "$1" == "-u" ]]; then
|
||||
rm -rf "$clonedir"
|
||||
find "$rimedir" -type l -delete
|
||||
else
|
||||
mkdir -p "$rimedir/opencc"
|
||||
mkdir -p "$clonedir"
|
||||
|
||||
cd "$rimedir"
|
||||
clonebasename="$(basename $clonedir)"
|
||||
git clone https://github.com/rime/rime-cantonese.git "$clonedir/rime-cantonese"
|
||||
for file in $(find "$clonebasename/rime-cantonese" -type f -name '*.yaml'); do ln -sf "$file"; done
|
||||
for file in $(find "$clonebasename/rime-cantonese/opencc" -type f); do ln -sf "../$file" "opencc"; done
|
||||
|
||||
git clone https://github.com/CanCLID/rime-loengfan.git "$clonedir/rime-loengfan"
|
||||
for file in $(find "$clonebasename/rime-cantonese" -type f -name '*.yaml'); do ln -sf "$file"; done
|
||||
fi
|
Loading…
Reference in New Issue
Block a user