banner
xingli

xingli

猫娘爱好者

Fcitx5輸入法美化

使用搜狗輸入法於 Linux 系統#

下載此倉庫#

git clone https://github.com/fkxxyz/ssfconv.git
cd ssfconv

安裝庫#

建議使用 Python 3.7

pip install pycrypto
pip install numpy
pip install pillow

注意
如果你的 Python 版本是 3.10 以上
請執行以下的 pip 命令 未測試

pip install pycryptodome
pip install Pillow
pip install numpy

下載皮膚#

先從搜狗輸入法的皮膚官網下載自己喜歡的皮膚,得到 ssf 格式的文件,例如 charge.ssf

轉換皮膚#

./ssfconv  -t fcitx5 charge.ssf  charge

如果轉換成功,則終端不會有報錯信息,如果出現了

raceback (most recent call last):  
File "./ssfconv", line 1211, in <module>  
exit(main(args))  
File "./ssfconv", line 1183, in main  
result = ssf2fcitx5(skin_dir)  
File "./ssfconv", line 827, in ssf2fcitx5  
back_color = findBackgroundColor()  
File "./ssfconv", line 813, in findBackgroundColor  
-int(v[2])))  
File "./ssfconv", line 116, in getImageAvg  
if a.shape[2] == 4:  
IndexError: tuple index out of range

image類似這種錯誤,則文件轉換失敗,這種一般是搜狗輸入法皮膚不符合規範導致的,生成的文件無法使用,
image生成的內容缺少了關鍵的 theme.config 文件,無法被 fcitx5 輸入法識別。
正常生成的例子:

  1. 終端執行完程序沒有任何提示,然後程序目錄生成了對應文件夾。
[xingli@nekopara ssfconv]$ ./ssfconv -t fcitx5 charge.ssf charge  
[xingli@nekopara ssfconv]$

2. 文件夾內存在 theme.conf
image內部有類似下面的信息就是生成成功了

[Metadata]
Name=33·充電
Version=0.9
Author=阿克婭
Description=歡迎大家使用
ScaleWithDPI=False
[InputPanel]
Font=Sans 16
NormalColor=#0080c0
HighlightCandidateColor=#004080
HighlightColor=#0080c0
HighlightBackgroundColor=#f5fbfb
Spacing=3

複製到用戶皮膚目錄#

mkdir -p ~/.local/share/fcitx5/themes/
cp -r charge  ~/.local/share/fcitx5/themes/

使用該皮膚#

打開 fcitx5 的配置,附加組件標籤,經典用戶界面,點配置,在主題的下拉列表裡,選擇這款皮膚。
或者你也可以直接修改配置文件 ~/.config/fcitx5/conf/classicui.conf,將 Theme 的值改成這個皮膚的名稱即可。
用下面這條命令可以看到該皮膚的名稱:

grep Name ~/.local/share/fcitx5/themes/charge/theme.conf

image

載入中......
此文章數據所有權由區塊鏈加密技術和智能合約保障僅歸創作者所有。