pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.44k stars 87 forks source link

fcitx does not work #1445

Open yaolet opened 3 years ago

yaolet commented 3 years ago

(1) Issue/Bug Description:

After the latest updating, fcitx stopped working.

(2) Steps to reproduce (if you know):

  1. Fresh install a pop os from iso.
  2. switch language to Chinese (zh_CN)
  3. select fcitx as input
  4. install an input method such as fcitx-sunpinyin / sogou pinyin (deb file only).
  5. sudo apt update; sudo apt upgrade
  6. sign out, sign in;
  7. fcitx disappears

(3) Expected behavior: fcitx should work as normal;

fcitx diagnostics show that GTK_IM_MODULE QT_IM_MODULE and XMODIFIER ends are all set to ibus.
manually setting them in the .xprofile would allow fcitx to run again, but not autostart when login. it is a temporary fix.

(4) Distribution (run cat /etc/os-release):

Pop!_OS 20.10

(5) Gnome Shell version:

38.1

(6) Pop Shell version (run apt policy pop-shell or provide the latest commit if building locally): 1.1.0~16079823114~20.10~0fbf86c

(7) Where was Pop Shell installed from: sudo apt upgrade

(8) Monitor Setup (2 x 1080p, 4K, Primary(Horizontal), Secondary(Vertical), etc):

2880x1800

(9) Other Installed/Enabled Extensions: none

(10) Other Notes:

I have tried both on my working laptop and a fresh install, both failed.

meierw commented 3 years ago

Same here.

Also, one extra thing to add. In the fcitx configuration the entire list of input methods is empty.

Please fix this. :cry:

mmstick commented 3 years ago

Anything wrong with using ibus-pinyin or ibus-sunpinyin?

meierw commented 3 years ago

I've tried using ibus-mozc in the past (and currently using it while waiting for this fix), and it has always been annoying. Due to one simple issue of always defaulting to the useless Direct Input mode (A), instead of Hiragana (あ).

Every workaround for this annoyance, which can be found on the web, is:

fcitx didn't have any of these issues and allowed me to configure it easily, as well as commit the configuration to source control.

I gave IBus a solid try, since I genuinely did Not want to add another package on top of the base ones which come with Ubuntu/Pop-OS, and liked IBus integrates with Gnome. But functionally it simply failed me.

Fun-fact. If ibus-mozc just didn't default to Direct Input and instead defaulted to Hiragana (or let me configure it). It would definitely be my preferred choice.

mmstick commented 3 years ago

You can change the defaults in /etc/profile.d. Have you tried that?

meierw commented 3 years ago

No. Haven't tried that approach. I see there are a bunch of scripts in this dir, but they aren't self explanatory.

mmstick commented 3 years ago

They're shell scripts executed in alphabetical order, so you can make a script that calls export GTK_IM_MODULE=fcitx to change it system-wide for GTK.

meierw commented 3 years ago

Didn't work. Here's how my current /etc/profile.d looks like. I copied pop-im-ibus.sh to x-pop-im-fcitx.sh, modified the content and rebooted the machine.

 /e/profile.d  pwd
/etc/profile.d
 /e/profile.d  ls -alF
total 60
drwxr-xr-x   2 root root  4096 Dec 17 14:48 ./
drwxr-xr-x 147 root root 12288 Dec 17 09:45 ../
-rw-r--r--   1 root root    96 Sep 16 22:26 01-locale-fix.sh
-rw-r--r--   1 root root   833 Nov 20 01:51 apps-bin-path.sh
-rw-r--r--   1 root root   726 Sep  3 05:44 bash_completion.sh
-rw-r--r--   1 root root  1003 Aug 13  2019 cedilla-portuguese.sh
-rw-r--r--   1 root root   813 Aug 25 23:57 flatpak.sh
-rw-r--r--   1 root root   349 Jul 30 00:59 im-config_wayland.sh
-rw-r--r--   1 root root    84 Dec 15 07:12 pop-im-ibus.sh
-rw-r--r--   1 root root  1368 Sep 23 03:37 vte-2.91.sh
-rw-r--r--   1 root root   966 Sep 23 03:37 vte.csh
-rw-r--r--   1 root root   954 Sep 17 20:23 xdg_dirs_desktop_session.sh
-rw-r--r--   1 root root    87 Dec 17 14:50 x-pop-im-fcitx.sh
 /e/profile.d  cat pop-im-ibus.sh 
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"
export XMODIFIERS="@im=ibus"
 /e/profile.d  cat x-pop-im-fcitx.sh 
export GTK_IM_MODULE="fcitx"
export QT_IM_MODULE="fcitx"
export XMODIFIERS="@im=fcitx"
 /e/profile.d  

As I mentioned before, the list of Input Methods in fcitx configuration is now empty (even after a full purge and reinstall of fcitx). So my best, albeit uninformed guess, is that some low level dependency has changed and broken fcitx. The wiring between GTK and fcitx probably isn't the issue here...? :confused:

image

mmstick commented 3 years ago

The only recent update was setting GTK_IM_MODULE back to ibus as the default module as it was in 20.04. The fcitx packages come from Ubuntu and I doubt they've changed recently.

yaolet commented 3 years ago

my issue is, before the update, the default ibus could be changed by gnome-language-selector into fcitx, like ubuntu 20.10 and other variants. , but after the update, even it sets to fcitx, the shell starts ibus regardless, disrepecting this configuration... im-config does not work, even I set GTK_IM_MODULE etc into fcitx, ibus daemon still runs.....

yaolet commented 3 years ago

thanks mmstick for the advice. Of course I can still manage by doing small tweaks so that fcitx can run. but this problem exists on a fresh-installed system base. An end user should not get his/her desired input method by jumping hoops. using gnome-language-selector should work as expected, but now it is not.

wychuzord commented 3 years ago

Didn't work. Here's how my current /etc/profile.d looks like. I copied pop-im-ibus.sh to x-pop-im-fcitx.sh, modified the content and rebooted the machine.

 /e/profile.d  pwd
/etc/profile.d
 /e/profile.d  ls -alF
total 60
drwxr-xr-x   2 root root  4096 Dec 17 14:48 ./
drwxr-xr-x 147 root root 12288 Dec 17 09:45 ../
-rw-r--r--   1 root root    96 Sep 16 22:26 01-locale-fix.sh
-rw-r--r--   1 root root   833 Nov 20 01:51 apps-bin-path.sh
-rw-r--r--   1 root root   726 Sep  3 05:44 bash_completion.sh
-rw-r--r--   1 root root  1003 Aug 13  2019 cedilla-portuguese.sh
-rw-r--r--   1 root root   813 Aug 25 23:57 flatpak.sh
-rw-r--r--   1 root root   349 Jul 30 00:59 im-config_wayland.sh
-rw-r--r--   1 root root    84 Dec 15 07:12 pop-im-ibus.sh
-rw-r--r--   1 root root  1368 Sep 23 03:37 vte-2.91.sh
-rw-r--r--   1 root root   966 Sep 23 03:37 vte.csh
-rw-r--r--   1 root root   954 Sep 17 20:23 xdg_dirs_desktop_session.sh
-rw-r--r--   1 root root    87 Dec 17 14:50 x-pop-im-fcitx.sh
 /e/profile.d  cat pop-im-ibus.sh 
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"
export XMODIFIERS="@im=ibus"
 /e/profile.d  cat x-pop-im-fcitx.sh 
export GTK_IM_MODULE="fcitx"
export QT_IM_MODULE="fcitx"
export XMODIFIERS="@im=fcitx"
 /e/profile.d  

As I mentioned before, the list of Input Methods in fcitx configuration is now empty (even after a full purge and reinstall of fcitx). So my best, albeit uninformed guess, is that some low level dependency has changed and broken fcitx. The wiring between GTK and fcitx probably isn't the issue here...? confused

image

I've managed to add input methods to fcitx after killing ibus and starting fcitx manually, however I still couldn't switch between them or rather the input method was indicated to be Japanese in GUI but actually was my default input method. I didn't see any visual indication of input mode switching either.

wychuzord commented 3 years ago

Anything wrong with using ibus-pinyin or ibus-sunpinyin?

Don't know about Chinese but Japanese in ibus is very cumbersome because it's in Latin alphabet by default and I haven't been able to find any way to switch it into hiragana with a keyboard shortcut. It doesn't sound as much but having to do it so many times it gets on your nerves and that's why I've installed Fcitx and used it without a problem until few days ago.

miaodi commented 3 years ago

still no updates?

LumenYoung commented 3 years ago

They're shell scripts executed in alphabetical order, so you can make a script that calls export GTK_IM_MODULE=fcitx to change it system-wide for GTK.

Yes, there are some issue with the ibus pinyin. I'm not sure the cause but the key mapping of Pinying IM would be the key mapping of the previous input. For example, I use English, German and Chinese in my daily life. German input is different from English in key y and z(in german keyboard they switched position). When I use the german input first and switch to the pinyin, then the y and z has been changed in to German style. It is very uncomfortable since most of the Chinese would use only the English keyboard layout, and it is inconvinient because the same input method would vary because the previous used langague.

I wonder if is problem has been raised to you before. Hope you can see that.

taq-okz commented 3 years ago

I think I figured out why fcitx is not launched. Short story: Remove /etc/profile.d/pop-im-ibus.sh and reboot.

Long story: /etc/profile.d/pop-im-ibus.sh (source'ed in /etc/gdm3/Xsession ) sets envvar XMODIFIERS (and 2 others). Further down the road, in /etc/X11/Xsession.d/70im-config_launch (also source'ed in /etc/gdm3/Xsession ) :

if [ -z "$XMODIFIERS" ] && \  # i.e. if envvar XMODIFIERS is not set
   ...
   # set envvars to launch user specified IM
fi

Since XMODIFIERS is set, the set envvars to launch user specified IM part is not executed, therefore fcitx is not launched. BTW, the file /etc/profile.d/pop-im-ibus.sh first appears in ver 4 iso (pop-os_20.10_amd64_intel_4.iso) released mid December.

wychuzord commented 3 years ago

I think I figured out why fcitx is not launched. Short story: Remove /etc/profile.d/pop-im-ibus.sh and reboot.

Long story: /etc/profile.d/pop-im-ibus.sh (source'ed in /etc/gdm3/Xsession ) sets envvar XMODIFIERS (and 2 others). Further down the road, in /etc/X11/Xsession.d/70im-config_launch (also source'ed in /etc/gdm3/Xsession ) :

if [ -z "$XMODIFIERS" ] && \  # i.e. if envvar XMODIFIERS is not set
   ...
   # set envvars to launch user specified IM
fi

Since XMODIFIERS is set, the set envvars to launch user specified IM part is not executed, therefore fcitx is not launched. BTW, the file /etc/profile.d/pop-im-ibus.sh first appears in ver 4 iso (pop-os_20.10_amd64_intel_4.iso) released mid December.

That didn't work at all for me. fcitx ran but I couldn't switch between input modes neither via keyboard nor mouse so same thing as with killing ibus and launching fcitx manually.

kuang-da commented 3 years ago

I think I figured out why fcitx is not launched. Short story: Remove /etc/profile.d/pop-im-ibus.sh and reboot.

Long story: /etc/profile.d/pop-im-ibus.sh (source'ed in /etc/gdm3/Xsession ) sets envvar XMODIFIERS (and 2 others). Further down the road, in /etc/X11/Xsession.d/70im-config_launch (also source'ed in /etc/gdm3/Xsession ) :

if [ -z "$XMODIFIERS" ] && \  # i.e. if envvar XMODIFIERS is not set
   ...
   # set envvars to launch user specified IM
fi

Since XMODIFIERS is set, the set envvars to launch user specified IM part is not executed, therefore fcitx is not launched. BTW, the file /etc/profile.d/pop-im-ibus.sh first appears in ver 4 iso (pop-os_20.10_amd64_intel_4.iso) released mid December.

This works perfectly for me. Thanks!

kuang-da commented 3 years ago

I organized my experience about installing Fcitx5 into this gist in Chinese. It finally works on my machine, so maybe it could help others as well.

yaolet commented 3 years ago

I think I figured out why fcitx is not launched. Short story: Remove /etc/profile.d/pop-im-ibus.sh and reboot.

Long story: /etc/profile.d/pop-im-ibus.sh (source'ed in /etc/gdm3/Xsession ) sets envvar XMODIFIERS (and 2 others). Further down the road, in /etc/X11/Xsession.d/70im-config_launch (also source'ed in /etc/gdm3/Xsession ) :

if [ -z "$XMODIFIERS" ] && \  # i.e. if envvar XMODIFIERS is not set
   ...
   # set envvars to launch user specified IM
fi

Since XMODIFIERS is set, the set envvars to launch user specified IM part is not executed, therefore fcitx is not launched. BTW, the file /etc/profile.d/pop-im-ibus.sh first appears in ver 4 iso (pop-os_20.10_amd64_intel_4.iso) released mid December.

thanks! exactly the date I encountered the problem!! can the dev team remove the above-mentioned script?

ngtban commented 2 years ago

I can confirm that this issue is still happening even on 21.10.

miaoerwu commented 2 years ago

Anything wrong with using ibus-pinyin or ibus-sunpinyin?

@mmstick I am using Intelligent Pinyin (or ibus-libpinyin) which is based on libpinyin and is a Simplified Chinese Pinyin input method that comes with gnome(maybe so, but ubuntu and pop!_os both come with this Simplified Chinese input method by default).

According to my experience, it is rather unstable, and occasionally it will falsely die when activated or de-activated. According to its wiki, i need to run $rm ~/.cache/ibus/libpinyin/user.conf and re-login to get it working again. Moreover, the frequency of this problem is not fixed, and it happens quite often, so I need to delete the files in the cache and log in again every time, which brings a very bad experience. And it looks like ibus hasn't been updated for a long time!

Of course, there are also various problems in the jetbrains IDE that drive developers crazy. So fcitx (fcitx4) or fcitx5 is one of the few options available. Since fcitx has been discontinued and fcitx seems to have no less problems than ibus in the jetbrains IDE, it looks like fcitx5 is the only option left (although it still has problems, but that's the jetbrain IDE runtime or rather jdk problem, so it is not solved at the input method level) but at least it is possible to input simplified Chinese into the jetrains IDE normally.

So I installed fcitx5 in pop!_os 20.10 and it seems to be working very well so far. Although there was a problem during the installation (due to /etc/profile.d/pop-im-ibus.sh, thanks very much for the solution provided in the comments, after removing this sh file it worked fine), it was quickly resolved.

So, it seems we (maybe all users who need to input Chinese or other users who need to use fcitx or ibus to input some language) need a more modern and user friendly input method. I think fcitx5 can be an option for users to choose whether to use it or not. So there may be a better way for users to switch to fcitx5 more easily.

Finally, I am looking forward to see your reply, and thanks a lot to system76 team for bringing us pop!_os.

miaoerwu commented 2 years ago

Anything wrong with using ibus-pinyin or ibus-sunpinyin?

@mmstick I am using Intelligent Pinyin (or ibus-libpinyin) which is based on libpinyin and is a Simplified Chinese Pinyin input method that comes with gnome(maybe so, but ubuntu and pop!_os both come with this Simplified Chinese input method by default).

According to my experience, it is rather unstable, and occasionally it will falsely die when activated or de-activated. According to its wiki, i need to run $rm ~/.cache/ibus/libpinyin/user.conf and re-login to get it working again. Moreover, the frequency of this problem is not fixed, and it happens quite often, so I need to delete the files in the cache and log in again every time, which brings a very bad experience. And it looks like ibus hasn't been updated for a long time!

Of course, there are also various problems in the jetbrains IDE that drive developers crazy. So fcitx (fcitx4) or fcitx5 is one of the few options available. Since fcitx has been discontinued and fcitx seems to have no less problems than ibus in the jetbrains IDE, it looks like fcitx5 is the only option left (although it still has problems, but that's the jetbrain IDE runtime or rather jdk problem, so it is not solved at the input method level) but at least it is possible to input simplified Chinese into the jetrains IDE normally.

So I installed fcitx5 in pop!_os 20.10 and it seems to be working very well so far. Although there was a problem during the installation (due to /etc/profile.d/pop-im-ibus.sh, thanks very much for the solution provided in the comments, after removing this sh file it worked fine), it was quickly resolved.

So, it seems we (maybe all users who need to input Chinese or other users who need to use fcitx or ibus to input some language) need a more modern and user friendly input method. I think fcitx5 can be an option for users to choose whether to use it or not. So there may be a better way for users to switch to fcitx5 more easily.

Finally, I am looking forward to see your reply, and thanks a lot to system76 team for bringing us pop!_os.

Recently I tried to switch back to system default ibus from fcitx5 because jetbrains fixed the problem that ibus input method is not working in IDE. now I am running pop!_os 22.04 and the version of ibus-libpinyin has been upgraded due to system upgrade. After experiencing for some time, I found the stability problem still exist. The input method shows that it is active, but it does not work properly. I still need to run $rm ~/.cache/ibus/libpinyin/user.conf and log back in to the system to get back to normal.

Also occasionally, after system upgrade, it will cause pop-im-ibus.sh file to be restored, so that fcitx5 cannot be used. Maybe it would be a better choice to give this choice to user, for example, generate a pop-im-fcitx5.sh file to take effect when the keyboard input method system set in system is fcitx5, if the choice is ibus, pop-im-ibus.sh takes effect.

Finally, hope pop!_os give a better system support for fcitx5. For example, when using fcixt5 to input in launcher, it can show candidate words (now you can input but can't see candidate words), in keyboard setting of system setting, it has selected fictx5 input source and can set shortcut key for typing (keyboard input setting in system setting is not very friendly to fcitx5). Maybe we can see some content in the new rust-based desktop?

I would like to get any related reply, thank you very much!

fifieldt commented 2 years ago

I'm also having this problem on Pop!_OS 22.04. The ibus pinyin methods are just not as good as fcitx right now. For example, like with @wychuzord's romaji-hiragana switch problem, there was a bug with ibus pinyin where it has a hardcoded default to simplified Chinese.

I use traditional Chinese, so thousands of times a day I would run this loop:

  1. Enable pinyin input
  2. Click the ibus icon on the taskbar, click traditional Chinese
  3. Type some text
  4. Need to perform a task in English (such as inserting an English word into my current sentence, entering a URL, working on the commandline)
  5. switch back to keyboard input and complete that action
  6. Enable pinyin input
  7. Click the ibus icon on the taskbar, click traditional Chinese

The way ibus is force-locked on has made using a System76 machine a nightmare in a bilingual context. I have since shifted some of my working habits to use another machine that has fcitx instead, but would really like to use my laptop for those tasks. A fix to this issue would be great, and I'm happy to help if there's a way I can.

fifieldt commented 2 years ago

A quick search found dozens of other users discussing this issue: https://pc.faqs.tw/%E6%83%B3%E5%B9%ABpop-_os-20-10%E8%A3%9Dgcin-1622645119 https://www.reddit.com/r/pop_os/comments/ou2ni4/fcitx_broken/ https://zhuanlan.zhihu.com/p/438725234 https://ptthito.com/linux/m-1622616327-a-430/ https://jixun.uk/posts/2021/pop-os-21-04-install-fcitx-rime/

jackpot51 commented 2 years ago

I don't have issues with using pinyin input if I follow these steps:

Is there something specific not provided by this input method?

fifieldt commented 2 years ago

@jackpot51 , many thanks for looking into this issue.

With respect to the significant time and effort required to test packages, and acknowledging that this is quite a specific issue, I would humbly suggest that the ability to merely input a given language is not a sufficient threshold to determine a CJK IME is good enough to forcibly disable others.

For expediency, I am going to make an assumption that CJK languages may not be daily working languages for yourself. If that's not correct, please disregard the following with my apologies :) As an example, beyond just being able to input characters, when you're writing full paragraphs in lengthy documents the ability for the IME to suggest the most 'natural' character combinations for the given phonetic in the given sentence context is fairly important. If it works well, you can frequently see what you want in the first row of suggestions. If it doesn't, you can be scanning dozens of suggestion rows to find the character you want. This makes a big difference in the speed of input, amoungst other things.

The crucial point here is that there's no standard way to do this - every IME has its own methodology. Accordingly, you'll find that different users have different (and strong) preferences. Where a preference is not available, depending on the quality (perceived or actual) of the IME this ranges from a major annoyance to a complete inability to use the computer (especially in the case of some older users with years of 'comfortable' use of a specific IME).

Since an IME affects one of the most basic aspects of using a machine, issues with an IME has an outsized effect. Imagine being annoyed every time you have to type something! Personally, I shudder to think about how much time I have spent switching a buggy IME between character sets :)

My conclusion as a daily and heavy user of a CJK IME is that there's no specific feature presence or absence that is sufficient to justify actively preventing a user choice of an IME.

kuang-da commented 2 years ago

@jackpot51 Thank you for the detailed solution to enable the default Ubuntu/PopOS pinyin. But I would like to comment that the default pinyin is based on iBus, an input method (IM) framework and it is not compatible with JetBrain IDE. That was the main reason for me to explore fcitx5 as the alternative IM framework. I have not tested this for a year but it has been a persistent problem.

miaoerwu commented 2 years ago

I don't have issues with using pinyin input if I follow these steps:

  • Open Settings
  • Navigate to Keyboard tab
  • Under Input Sources, click the + button
  • Select Chinese (China)
  • Select Chinese (Intelligent Pinyin)
  • Click the Add button
  • Under Input Sources, click the three dots button next to Chinese (Intelligent Pinyin)
  • Click Preferences from the drop down to open a settings dialog
  • Select settings as desired, for example, switch from Simplified to Traditional
  • Close the dialog with the Close button
  • Switch languages to the pinyin input with Super+Space, or Win+Space
  • 输入中文 / 輸入中文

Is there something specific not provided by this input method?

@jackpot51 The problem with Intelligent Pinyin (or ibus-libpinyin) is that the input does not have any effect or appears directly as letters of the alphabet, and no candidate words appear, it is a completely unavailable state. After waiting 20 to 30 seconds and reactivating the input method, the problem disappeared.

In my experience, Intelligent Pinyin has a prerequisite for problems: it needs to be used for a long time. And the frequency and scenarios of the problem are different. The problem occurs maybe during normal typing, maybe after hitting the backspace key, maybe after switching input methods or activating them, and so on and so forth.

I'm guessing you don't use Chinese input for a long time (maybe my guess is wrong, sorry), so it's not a problem when you simply enter a few Chinese words or use it for a short time. This problem has actually been fed back to Intelligent Pinyin's developer, but so far, no valuable reply or solution has been received.

I have tried to switch to fcitx5 before, the root cause of my switch is the problem of using in JetBrain IDE. But fcitx5 has some problems in pop!_os, such as.

  1. you need to configure boot up automatically after installation
  2. you need to delete /etc/profile.d/pop-im-ibus.sh configuration file after installation to make fcitx5 available
  3. After system update, pop-im-ibus.sh file will be restored occasionally, so you need to delete it several times.

The above is my personal problem in using fcitx5, maybe there are others similar to me.

So maybe it is a good idea to add fcitx5 to the system, because it is quite good from the feedback we got from various sources. Of course this is just my personal opinion, the final decision needs to be discussed together.

Finally, thanks for your reply! Meanwhile, I hope system76 and pop!_os are getting better and better!

taq-okz commented 2 years ago

@jackpot51 Thanks for all the hard work you and the people at system76 has put into pop!_os.

As @miaoerwu pointed out:

you need to delete /etc/profile.d/pop-im-ibus.sh configuration file after installation to make fcitx5 available

I'm the one who proposed deleting pop-im-ibus.sh to make fcitx/fcitx5 work on pop!_os. I know this method is quite brutal, and has the following drawback:

After system update, pop-im-ibus.sh file will be restored occasionally, so you need to delete it several times.

Therefore, I'd like to propose a (somewhat quick-and-dirty) fix for pop-im-ibus.sh. current code:

export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"
export XMODIFIERS="@im=ibus"

modified code:

# Honor user .xinputrc.
# Check if user .xinputrc has "run_im ..." line
grep -q '^run_im' "$HOME/.xinputrc" 2>/dev/null

# if grep fails (i.e. .xinputrc does not exist or does not have "run_im" line)
if [ $? -ne 0 ] ; then
    # original pop-im-ibus.sh
    export GTK_IM_MODULE="ibus"
    export QT_IM_MODULE="ibus"
    export XMODIFIERS="@im=ibus"
fi
jackpot51 commented 2 years ago

Thanks for the responses. I have not had the issue @miaoerwu mentioned, but it is possible I do not use pinyin input methods enough. Incompatibility with JetBrains is easier for me to verify.

miaoerwu commented 2 years ago

Thank you very much for your reply! I hope to see this issue improved in the near future. @jackpot51

jeff-j-chen commented 1 year ago

@taq-okz Unfortunately neither deleting pop-im-ibus.sh or changing it seemed to fix it for me, IBus is the startup input method regardless. I used to have fcitx working, I did a clean reinstall (due to unrelated issues), and now it just refuses to work!

jeff@pop-os:/etc/profile.d$ cat pop-im-ibus.sh
# Honor user .xinputrc.
# Check if user .xinputrc has "run_im ..." line
grep -q '^run_im' "$HOME/.xinputrc" 2>/dev/null

# if grep fails (i.e. .xinputrc does not exist or does not have "run_im" line)
if [ $? -ne 0 ] ; then
    # original pop-im-ibus.sh
    export GTK_IM_MODULE="ibus"
    export QT_IM_MODULE="ibus"
    export XMODIFIERS="@im=ibus"
fi

Just wanted to add to the discussion about ibus-pinyin, even the "Intelligent" Chinese Pinyin system is just awful. I mentioned this on a reddit post over two years ago. It isn't actually intelligent and will simply pick the most common character, even if it makes no sense in context. Other systems like the fcitx's googlepinyin and cloudpinyin are head and shoulders above anything provided by Ibus, frustratingly enough.

shironoY6 commented 1 year ago

@4a454646

The modified /etc/profile.d/pop-im-ibus.sh approach by @taq-okz above worked for me.

But I had to clean up the ibus mozc settings to make it work.

  1. Delete mocz from input methods (Setting - Keyboard)
  2. Remove customized keyboard shortcuts for Typing (Switch to next input source / Switch to previous input source)
  3. modify pop-im-ibus.sh
  4. Region & Language -> Manage Install Languages -> Keyboard input system to fcitx 4
  5. reboot

Now Ctrl+Space should toggle/switch the input methods.

P.S. In May 2024, another update overwrite my modified pop-im-ibus.sh and I had to repeat this again. But it still does work. Please consider to merge this into the master. Maybe @taq-okz or I should make a proper PR?

taq-okz commented 1 year ago

@shironoY6

P.S. In May 2024, another update overwrite my modified pop-im-ibus.sh and I had to repeat this again. But it still does work. Please consider to merge this into the master. Maybe @taq-okz or I should make a proper PR?

If you feel like making a PR, go ahead.
( I couldn't find the repos for making the PR)

mdonoughe commented 11 months ago

Instead of deleting or modifying pop-im-ibus.sh, you can make a new file named /etc/profile.d/zz-no-ibus.sh containing the following:

unset GTK_IM_MODULE
unset QT_IM_MODULE
unset XMODIFIERS

System updates won't touch this file.

If you want to use the grep trick you can try something like this:

# Honor user .xinputrc.
# Check if user .xinputrc has "run_im ..." line
grep -q '^run_im' "$HOME/.xinputrc" 2>/dev/null

# if grep succeeds (i.e. .xinputrc exists and has "run_im" line)
if [ $? -eq 0 ] ; then
    # Unset variables from pop-im-ibus.sh
    unset GTK_IM_MODULE
    unset QT_IM_MODULE
    unset XMODIFIERS
fi