Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Solved] The method of extending fcitx with the fcitx-cloudpinyin module for the deepin base image. #31

Closed
hongyi-zhao opened this issue Nov 26, 2020 · 11 comments
Labels

Comments

@hongyi-zhao
Copy link

hongyi-zhao commented Nov 26, 2020

I've solved the problem. Both of the following methods can do the trick.

  1. Install the fcitx-module-cloudpinyin package shipped in the deepin repo.

  2. Compile the module based on its latest git master source code as following.

$ sudo apt install build-essential cmake fcitx-libs-dev libcurl4-openssl-dev
$ git clone https://github.com/fcitx/fcitx-cloudpinyin.git fcitx/fcitx-cloudpinyin.git
$ cd fcitx/fcitx-cloudpinyin.git/
$ mkdir build
$ cd build/
$ cmake ..
$ make
$ sudo cp src/fcitx-cloudpinyin.so /usr/lib/x86_64-linux-gnu/fcitx/
@hongyi-zhao hongyi-zhao changed the title Extend the base image with fcitx-cloudpinyin support. Extend the base image with fcitx-cloudpinyin support for fcitx-sunpinyin. Nov 26, 2020
@hongyi-zhao hongyi-zhao changed the title Extend the base image with fcitx-cloudpinyin support for fcitx-sunpinyin. Extend the deepin base image with fcitx-cloudpinyin support for fcitx-sunpinyin. Nov 26, 2020
@mviereck
Copy link
Owner

mviereck commented Nov 26, 2020

You could just install the package fcitx-module-cloudpinyin instead.

(Side note: I've installed fcitx-sunpinyin because it is listed in the recommends of package dde.)

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 26, 2020

You could just install the package fcitx-module-cloudpinyin instead.

I've learned that this package is too outdated to retrieve the cloud data correctly, so I decide to compile the latest git master version of it.

(Side note: I've installed fcitx-sunpinyin because it is listed in the recommends of package dde.)

Thanks for your clarification on the reason for selection this package.

@hongyi-zhao
Copy link
Author

Another problem is I must manually add sunpinyin into the input method list of the input method configuration UI each time after I entered the container as the screenshot shown below:

image

Are there some commands/instructions for doing this job in the docker file during the image building progress?

@mviereck
Copy link
Owner

Are there some commands/instructions for doing this job in the docker file during the image building progress?

It should be possible with providing an fcitx configuration file in /etc/skel. Have a look in ~/.config after you have done your settings in which file the setting is stored. Compare similar attempts in x11docker/lxde.

If you run with option --home, the setting is stored, too.

On compiling and enabling cloudpinyin: This is not an x11docker or x11docker/deepin issue, I don't want to debug this myself.

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 26, 2020

If you run with option --home, the setting is stored, too.

Still not so clear on your above note. Based on the description of the --home option:

 -m, --home [=ARG]     Create a persistant HOME folder for data storage.
                       Default: Uses ~/.local/share/x11docker/IMAGENAME.

According to my understanding, if I'm using --home without any argument, the ~/.local/share/x11docker/IMAGENAME will be used for persistent data storage. But based my testings, use this option can't let me use the previous settings at all. I'm not sure whether I've understood your meaning correctly.

@mviereck
Copy link
Owner

mviereck commented Nov 26, 2020

But based my testings use this option can't let me use the previous settings automatically.

It seems the configuration is stored, but running fcitx in autostart is not enough.
Likely command fcitx must be replaced with fcitx-autostart in the fcitx.desktop file. I am testing soon.

@mviereck
Copy link
Owner

Fixed!


# fcitx: Chinese input support
ENV XMODIFIERS=@im=fcitx QT4_IM_MODULE=fcitx QT_IM_MODULE=fcitx GTK_IM_MODULE=fcitx
RUN apt-get update && \
    env DEBIAN_FRONTEND=noninteractive apt-get install -y \
        fcitx-sunpinyin && \
    mkdir -p /etc/xdg/autostart && \
    echo "[Desktop Entry]\n\
Encoding=UTF-8\n\
Version=0.9.4\n\
Type=Application\n\
Name=fcitx\n\
Comment=\n\
Exec=/usr/bin/fcitx-autostart\n\
" > /etc/xdg/autostart/fcitx.desktop && \
    /cleanup

With option --home the setting is stored (has been before, too), but now it immediatly works after startup without running the config gui again.

@hongyi-zhao
Copy link
Author

Do you mean the --home option is needless anymore with the above fix applied?

@mviereck
Copy link
Owner

mviereck commented Nov 26, 2020

Do you mean the --home option is needless anymore with the above fix applied?

No, without --home you need to select the input method every time.
With option --home your fcitx configuration will be stored.

Edit: deepin seems to have a configuration storage issue. I've opened ticket #32 .

@hongyi-zhao
Copy link
Author

hongyi-zhao commented Nov 27, 2020

Fixed!

I tried to build the docker image with the latest Dockerfile which, including this fix, is slightly revised from your latest git master version, but still I must run the config GUI once when startup the container for the first time. See the screenshot as shown below for more info:

image

@hongyi-zhao hongyi-zhao changed the title Extend the deepin base image with fcitx-cloudpinyin support for fcitx-sunpinyin. [Solved] The method for extending fcitx with fcitx-cloudpinyin support used by the deepin base image. Nov 27, 2020
@hongyi-zhao hongyi-zhao changed the title [Solved] The method for extending fcitx with fcitx-cloudpinyin support used by the deepin base image. [Solved] The method for extending fcitx with fcitx-cloudpinyin module for the deepin base image. Nov 27, 2020
@hongyi-zhao hongyi-zhao changed the title [Solved] The method for extending fcitx with fcitx-cloudpinyin module for the deepin base image. [Solved] The method of extending fcitx with the fcitx-cloudpinyin module for the deepin base image. Nov 27, 2020
@hongyi-zhao hongyi-zhao reopened this Nov 27, 2020
@hongyi-zhao
Copy link
Author

For fcitx5, fcitx5-module-cloudpinyin is merged into fcitx5-chinese-addons as a submodule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants