arewewaylandyet icon indicating copy to clipboard operation
arewewaylandyet copied to clipboard

Mention that IME is not in usable state

Open pickfire opened this issue 4 years ago • 15 comments

IME, Input Method Editor is used for asian to enter text.

There are a few IME but I think fcitx5 supports it but there are still issues. I think ibus and fcitx does not support wayland yet.

From what I recall, freedesktop have input proposal unstable input method protocol v1 but I don't think anyone is using that.

Sway have their own input method protocol v2 which is not in freedesktop but I think that is what others implements.

I haven't been keeping up with this but I don't think wayland is usable yet for anyone that needs IME.

pickfire avatar Nov 06 '20 01:11 pickfire

Hi @pickfire, I'm running sway and ibus works perfectly fine for me and others, did not try fcitx. It's been supported since sway 1.5 See the following sway issues: https://github.com/swaywm/sway/issues/873 and https://github.com/swaywm/sway/issues/4841

madblobfish avatar Nov 23 '20 13:11 madblobfish

Hi @madblobfish Could you please share your config or how do you setup it?

hukacode avatar May 11 '21 12:05 hukacode

@hukacode I do not know if this will help you, because I do not use a greeter as most others do. Anyways, here are the parts that made it work for me (I somehow needed a restart, sway restart might be sufficient, idk):

  1. I use arch, so I installed all needed things for Japanese input with anthy by: pacman -Syu ibus-anthy
  2. I use fish and start sway directly after getty with the following snippet (~/.config/fish/config.fish):
if test (tty) = '/dev/tty1' -a -z "$DISPLAY"
        exec sway # -d 2> /tmp/sway.log > /tmp/sway.log
end
  1. ~/.config/sway/config:
exec ibus-daemon -dr
bindsym $mod+space exec sh -c 'if [ "$(ibus engine)" = "anthy" ]; then ibus engine xkb:de:nodeadkeys:deu; else ibus engine anthy; fi'
  1. I use fish universal variables to configure the 3 required envs, you may use profile /etc/environment or whatever instead:
set -Ux GTK_IM_MODULE ibus
set -Ux QT_IM_MODULE ibus
set -Ux XMODIFIERS @im=ibus

I did not find or remember anything else I had to configure. But some applications do not play well with it, for example sublime-text3 once worked, but is currently broken for me (I think this might have something to do with the newer protocol in sway). kitty has a configuration option to use ibus, but I prefer the default. Firefox where I need to write the most just works.

I can't provide more help, good luck. グッドラック

PS: fixed formatting bug. Also here's how the guy who started sway does it: https://git.sr.ht/~sircmpwn/dotfiles/tree/master/item/.config/sway/config#L146 No idea where he sets the environment vars or starts ibus though.

madblobfish avatar May 17 '21 22:05 madblobfish

Hi @madblobfish

Thank you for your supporting. I really appreciate it. I can type Japanese, Vietnamese on sway now.

Best regards, Huka

hukacode avatar May 18 '21 01:05 hukacode

@madblobfish this would be awesome to add to wiki or docs or contrib/ somewhere...

jedahan avatar May 18 '21 14:05 jedahan

@jedahan Feel free to do so

madblobfish avatar May 18 '21 16:05 madblobfish

In my case it works for GTK and Qt programs, but not "generic" programs, such as the foot terminal, or alacritty terminal.

Also, ibus has a very useful feature of adding emoji with suggestions, as well as typing charaters by their Unicode value. (Shift+Super+e and Shift+Super+u in my case).

Has anyone found a way to use those with Wayland/Sway?

ghost avatar Feb 15 '22 09:02 ghost

In my case it works for GTK and Qt programs, but not "generic" programs, such as the foot terminal, or alacritty terminal.

@lockywolf I think foot and alacritty use a newer input protocol so ibus does not work there. I tried xfce4-terminal and ibus does work.

minhduc0711 avatar Mar 31 '22 20:03 minhduc0711

For me at least, I've followed all the configs listed in various threads and still can't get a working configuration. Perhaps there's a specific issue with Pinyin? I have this same issue mentioned in 2019:

The pinyin selection dialog flashes in the upper left but goes away immediately for me. If I press space very quickly after typing my character, I can at least get the first match to be selected ... but given how Chinese works, that's pretty much useless—we really need to be able to scroll through the match list.

I've also noticed the same behavior when trying to use key combinations to switch between IMEs. Oddly enough, it does work on xwayland applications but that's not all that useful in my case.

Also worth mentioning, it's not a Wayland issue as everything works flawlessly under Gnome.

Madwonk avatar Apr 07 '23 20:04 Madwonk

No, it is deceptively inaccurate that everything works flawlessly under GNOME: GNOME supports IBus specifically, not IMEs generally. Some users of lightweight environments like Sway might want lightweight IMEs like fcitx5.

Similarly, beware that some applications experienced working may be due to bypassing Wayland either via GTK, Qt, or Xwayland.

GNOME support is implemented through Wayland input-method v1. Some alternatives including wlroot-based environments like Sway use Wayland input-method v2.

Overview of involved Wayland protocols

IBus issue and draft code with plea for help

Hints on escape sequences to enable IBus in foot, supported since v1.6.0 (as build-time option, so check that your build of foot actually supports it before pulling hair out).

jonassmedegaard avatar Aug 09 '23 10:08 jonassmedegaard

For interacting with IMEs each environment may need additional support for placing its popup dialog - e.g. Sway may(be still) need the patch mentioned here

jonassmedegaard avatar Aug 09 '23 11:08 jonassmedegaard

IBus panel is not yet supported for Wayland and should be disabled, instead switching engine using explicit calls to ibus engine.

jonassmedegaard avatar Aug 09 '23 11:08 jonassmedegaard

I guess not a lot of people think about this: IMEs aren't only for asian text, you also get a lot of extras like emoji support without every GUI having to implement their own version of it (it makes a lot more sense as an IME, you also get this on phones with whatever software keyboards you install there...). With fcitx5's quickphrase I can just hit a hotkey and type :rocket: to type a 🚀, but for this to work well enough we need popup support. Sway still lacks this :-(

Blub avatar Aug 18 '23 07:08 Blub

For interacting with IMEs each environment may need additional support for placing its popup dialog - e.g. Sway may(be still) need the patch mentioned here

That patch works for most applications, but a notable exception is electron-based applications https://github.com/electron/electron/issues/33662

RyanGibb avatar Jan 31 '24 18:01 RyanGibb