mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

Fail to use the host ubuntu input method, such as the Chinese input method #269

Closed imwcc closed 4 years ago

imwcc commented 4 years ago

Fail to use the host ubuntu input method, such as the Chinese input method. is anyone known how to enable it?

I use the follow docker image:

x11docker  --desktop --dpi 150 --gpu --clipboard --sudouser --lang="zh_CN" --showid --  --  x11docker/lxde-wine
imwcc commented 4 years ago

Hi @mviereck

Could you have any comments ? Thank you very much.

mviereck commented 4 years ago

Hi,

Do you get any error messages? Could you show me the terminal output, please? If there is no obvious error message, please run with --debug and show me the output.

imwcc commented 4 years ago

Hi @mviereck Run with --debug When I press the "shift" keyboard to switch method, nothing happens output in the terminal.

Here is the end of the terminal logs:

xinitrc=ready
containerid=91cce577f0a747b77622d66c9315229af662a3b58ba6c905564d5f60b2083278
pid1pid=5080
containerip=172.18.0.2
containerrootrc=ready
dockerrc=ready
xtermrc=ready
DEBUGNOTE[18:10:09,692]: storepid(): Stored pids:
3208 watchpidlist
3230 watchmessagefifo
4118 containershell
5230 dockerlogs
5596 dockerstopshell
5080 pid1pid
4611 xinit
4612 Xserver
DEBUGNOTE[18:10:09,696]: storeinfo(): x11docker=ready
DEBUGNOTE[18:10:09,836]: waitforlogentry(): containerrc: Found log entry "containerrootrc=ready" in store.info.
DEBUGNOTE[18:10:09,845]: Running containerrc: Unprivileged user commands in container
DEBUGNOTE[18:10:09,880]: containerrc: HOME is not empty. Not copying from /etc/skel
DEBUGNOTE[18:10:09,930]: containerrc: Running container command:  
    /usr/local/bin/start 

DEBUGNOTE[18:10:09,969]: waitforlogentry(): tailstderr: Found log entry "x11docker=ready" in store.info.
DEBUGNOTE[18:10:09,969]: waitforlogentry(): tailstdout: Found log entry "x11docker=ready" in store.info.
ln: failed to create symbolic link '/home/arvin/code': File exists
x11docker/lxde: If the panel does not show an approbate menu
  and you encounter high CPU usage (seen with kata-runtime),
  please run with option --init=systemd.

** Message: 18:10:10.174: main.vala:101: Session is LXDE
** Message: 18:10:10.174: main.vala:102: DE is LXDE
** Message: 18:10:10.300: main.vala:133: log directory: /home/arvin/.cache/lxsession/LXDE
** Message: 18:10:10.300: main.vala:134: log path: /home/arvin/.cache/lxsession/LXDE/run.log
imwcc commented 4 years ago

Seems sublime do not support ibus input framework. It captures all the keyboard input, and do not take input from ibus.

Please fix this so we can actually use in on Linux. Thanks.

Maybe it is a similar issue with it.

mviereck commented 4 years ago

Maybe I misunderstood you. First I thought the --lang=zh_CN option would fail. Does this work so far?

When I press the "shift" keyboard to switch method, nothing happens output in the terminal.

You mean a special input method giving other chinese chars if pressing shift. I am not familiar with that. Likely x11docker has to set up the X server to support this input method.

Can you tell me how you set up and configure this input method on the host system? This site describes several methods for keyboard input, is yours ibus?

Seems sublime do not support ibus input framework. It captures all the keyboard input, and do not take input from ibus. Maybe it is a similar issue with it.

Likely yes.

imwcc commented 4 years ago

Thank you for your support.

First I thought the --lang=zh_CN option would fail. Does this work so far? Unable to work.

I am using the Sogou pinyin with fcitx

As I know, the sougou pinyin is the most popular input method in China. regards to how to enable it, please refer to: https://www.yanlongwang.net/Ubuntu/install-sogou-ubuntu-18/

mviereck commented 4 years ago

I had some partial success adding fcitx-pinyin in the image:

FROM x11docker/lxde-wine
RUN apt-get update
RUN apt-get install -y fcitx-pinyin

It might further help to add fonts:

RUN apt-get install -y fonts-arphic-uming

Could you please build a test image and try out? So far I had success with russian input method. Steps:

imwcc commented 4 years ago

Got. thank you very much. I will retry it.

mviereck commented 4 years ago

If you succeed, I'd like to hear from you. Maybe x11docker could support this setup somehow, or at least give some instructions in the wiki.

imwcc commented 4 years ago

Ok

I found that the Chinese input is configured through GUI, so far I have not found the way to configure through command. If successful, I will update the comment. Thanks.