Using Sogou Input Method on Linux System#
Download this repository#
git clone https://github.com/fkxxyz/ssfconv.git
cd ssfconv
Install libraries#
It is recommended to use Python 3.7
pip install pycrypto
pip install numpy
pip install pillow
Note
If your Python version is 3.10 or above, please run the following pip commands (untested)
pip install pycryptodome
pip install Pillow
pip install numpy
Download skins#
First, download your favorite skins from the official website of Sogou Input Method skins. Obtain the ssf format file, for example, charge.ssf.
Convert skins#
./ssfconv -t fcitx5 charge.ssf charge
If the conversion is successful, there will be no error messages in the terminal. If you encounter an error like this:
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
similar to this error, the file conversion has failed. This is usually caused by Sogou Input Method skins not being compliant, resulting in generated files that cannot be used.
The generated content is missing the crucial theme.config file and cannot be recognized by fcitx5 input method.
Example of a successful generation:
- The terminal executes the program without any prompts, and the corresponding folder is generated in the program directory.
[xingli@nekopara ssfconv]$ ./ssfconv -t fcitx5 charge.ssf charge
[xingli@nekopara ssfconv]$
- The folder contains theme.conf
If there is information similar to the following inside, it means the generation is successful.
[Metadata]
Name=33·充电
Version=0.9
Author=阿克娅
Description=欢迎大家使用
ScaleWithDPI=False
[InputPanel]
Font=Sans 16
NormalColor=#0080c0
HighlightCandidateColor=#004080
HighlightColor=#0080c0
HighlightBackgroundColor=#f5fbfb
Spacing=3
Copy to user skin directory#
mkdir -p ~/.local/share/fcitx5/themes/
cp -r charge ~/.local/share/fcitx5/themes/
Use the skin#
Open the configuration of fcitx5, go to the Additional Components tab, Classic User Interface, click on Configure. In the drop-down list of themes, select this skin.
Alternatively, you can directly modify the configuration file ~/.config/fcitx5/conf/classicui.conf
and change the value of Theme to the name of this skin.
You can use the following command to see the name of this skin:
grep Name ~/.local/share/fcitx5/themes/charge/theme.conf