docker-firefox icon indicating copy to clipboard operation
docker-firefox copied to clipboard

Can put Fcitx software packge in the docker image?

Open lifetraveler opened this issue 3 years ago • 18 comments
trafficstars

Hi!some user like me,a chinese,use the docker-firefox for searching or input with my own mother language, but the docker-firefox only support english ime,the Fcitx software packge is a chinese ime,i wish docker-firefox can release with Fcitx ,thank u!

lifetraveler avatar Oct 31 '22 09:10 lifetraveler

U can input CJK fonts at outside anywhere, and COPY & PASTE into docker-firefox

need a web clipboard, like jishiben.me ( not AD )

nibazshab avatar Nov 01 '22 07:11 nibazshab

thank u. something like this docker-firefox in qnap nas os,called browser station,the way to handle this is just popup a floating box ,you can use your own ime to put chinese into it(pic 1),when its done,it passthough the text to the browser (pic 2)。 image

image

lifetraveler avatar Nov 04 '22 02:11 lifetraveler

oh, it also can, just need do this

  1. COPY fonts
  2. PASTE into left panel
  3. PASTE at docker-firefox

image

nibazshab avatar Nov 04 '22 04:11 nibazshab

i know the way,i hope it can be more easier without cv :) but thank u

lifetraveler avatar Nov 04 '22 06:11 lifetraveler

Do you know if there is a Firefox plugin that offer this functionality ?

jlesage avatar Nov 04 '22 12:11 jlesage

Also, the BrowserStation in QNAP seems to be a Chrome browser. Do you have anything to do to activate the popup floating window ? Is this implemented via a plugin ?

jlesage avatar Nov 04 '22 12:11 jlesage

yeah,its chrome brower, :)

--do you have anything to do to active the popup floating window ? Is this implemented via a plugin ? just switch my IME(Input Method Editors) into chinese mode,when you put key down ,its automatic active. i google a lot about that, some one says its maybe hard to image that for english user,there is a weblink to learn more about it.

here is a gif to get it qnap browser

lifetraveler avatar Nov 04 '22 16:11 lifetraveler

now i use the clipboard in sidebar. :),i may Take some time to get used to it。

qnap browser station is seemed to be a little slowlier when work with chinese input and not support proxy in browser。 your docker-firefox image support proxy,its much important than a chinese ime for me . thank u

lifetraveler avatar Nov 04 '22 16:11 lifetraveler

just switch my IME(Input Method Editors) into chinese mode,when you put key down ,its automatic active.

Who is providing this IME (the floating window) ? Is it your OS or the BrowserStation ?

jlesage avatar Nov 04 '22 16:11 jlesage

they are two parts,the floating window is provided by BrowserStation.IME is on the OS

lifetraveler avatar Nov 05 '22 07:11 lifetraveler

Hi!some user like me,a chinese,use the docker-firefox for searching or input with my own mother language, but the docker-firefox only support english ime,the Fcitx software packge is a chinese ime,i wish docker-firefox can release with Fcitx ,thank u!

Someone has packged ibus for alpine(download link). I have installed and started it. But it doesn't take effect in firefox. Maybe it is caued by some config. I installed fcitx in arch, and ime didn't take effect too. The problem was resolved by export environment config in startup script of my application. But it didn't resolve my problem in apline. 英语太过跛脚,我补充下中文:在百度贴吧我看过一个帖主打包了apline的ibus输入法。我安装了,也启动了。但是在firefox中不生效。不知道是不是环境变量的问题。之前我在arch的docker容器中装过fcitx,应用中输入法也是不生效,通过在应用的启动脚本中增加变量解决的。但我在alpine中没有解决,有兴趣你也可以试试。

tsurara-guobin avatar Jan 13 '23 02:01 tsurara-guobin

they are two parts,the floating window is provided by BrowserStation.IME is on the OS

kasm also provides this function. But it takes much more space.

tsurara-guobin avatar Jan 29 '23 08:01 tsurara-guobin

Using userscript in Firefox can auto read Clipboard on change, and input it into page. it is useful to me. @tsurara-guobin @lifetraveler

  1. Enter about:config in navigation bar
  2. Search dom.events.testing.asyncClipboard dom.events.asyncClipboard.readText and set true
  3. install a userscript addon such as https://addons.mozilla.org/zh-CN/firefox/addon/violentmonkey/
  4. add a userscript:
// ==UserScript==
// @name        auto Clipboard
// @match        https://*/*
// @match        http://*/*
// @grant       none
// @version     1.0
// @author      h2y
// @description 27/03/2023, 17:31:59
// ==/UserScript==

(_ => {
    let lastTxt = ""
    setInterval(_ => {
        let inp = document.querySelector("input:focus, textarea:focus");
        if (!inp) return;
        navigator.clipboard.readText().then(txt => {
            if (txt != lastTxt) {
                lastTxt = txt;
                if (inp.value != txt) inp.value = txt;
            }
        });
    }, 2000)
})()

h2y avatar Mar 27 '23 10:03 h2y

Using fcitx in this image is fairly simple.

  1. Start your docker-firefox container as usual
  2. Run docker exec -it #your_started_container_name# sh
  3. Run apk add fcitx5 fcitx5-chinese-addons --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing to install fcitx input method
  4. Commit your changes to the image
  5. Modify startapp.sh, start fcitx along with firefox
  6. Start your container with the following env variables set
    • LANG=zh_CN.UTF-8
    • XMODIFIERS=@im=fcitx
    • GTK_IM_MODULE=fcitx
    • QT_IM_MODULE=fcitx`
  7. Use Ctrl + Space to switch between English and Chinese
image

sxcsfan avatar Aug 09 '23 08:08 sxcsfan

在此图像中使用 fcitx 相当简单。

  1. 像往常一样启动 docker-firefox 容器

  2. 跑步docker exec -it #your_started_container_name# sh

  3. 运行 apk add fcitx5 fcitx5-chinese-addons --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing安装fcitx输入法

  4. 提交对图像的更改

  5. 修改startapp.sh,启动fcitx和firefox

  6. 使用以下环境变量集启动容器

    • 语言=zh_CN.UTF-8
    • X修饰符=@im=fcitx
    • GTK_IM_MODULE=fcitx
    • QT_IM_MODULE=fcitx`
  7. 用于Ctrl + Space切换英文和中文

图像

Can you provide a mirror image? thank you

shishugen avatar Sep 19 '23 05:09 shishugen

Dockerfile

FROM jlesage/firefox RUN apk add fcitx5 fcitx5-chinese-addons --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing ENV GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx5
LANG=zh_CN.UTF-8

docker exec -it firefox sh nohup fcitx5 > /dev/null 2>&1 &

image

pengfeiu avatar Mar 22 '24 07:03 pengfeiu

在此图像中使用 fcitx 相当简单。

  1. 像往常一样启动 docker-firefox 容器

  2. 跑步docker exec -it #your_started_container_name# sh

  3. 运行 apk add fcitx5 fcitx5-chinese-addons --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing安装fcitx输入法

  4. 提交对图像的更改

  5. 修改startapp.sh,启动fcitx和firefox

  6. 使用以下环境变量集启动容器

    • 语言=zh_CN.UTF-8
    • X修饰符=@im=fcitx
    • GTK_IM_MODULE=fcitx
    • QT_IM_MODULE=fcitx`
  7. 用于Ctrl + Space切换英文和中文

图像

Can you provide a mirror image? thank you

按照这个来进入火狐浏览器网页发现 Ctrl+space 切换不了输入法 然后进入firefox容器内 fcitx5-remote 会发现与dbus连接失败 然后apk下载dbus-demo和dbus,创建好用户组、文件夹、环境变量给予足够权限 后重启fcitx5,会发现fcitx5 报 E2024-04-23 16:43:51.530199 addonloader.cpp:61] Failed to create addon: dbus Unable to request dbus name. Is there another fcitx already running?

GODU-LZR avatar Apr 23 '24 08:04 GODU-LZR