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

get_ibus_addr: fix on x11 #1

Merged
merged 1 commit into from
May 9, 2024

Conversation

symphorien
Copy link
Contributor

this now returns a correct path on my machine, but I failed to use pmim on my machine. How to I set it up?

@secext2022
Copy link
Contributor

What went wrong when you run pmim ?

@secext2022 secext2022 merged commit 625978d into fm-elpac:main May 9, 2024
1 check passed
@secext2022
Copy link
Contributor

Thank you for your contribution !

@symphorien symphorien deleted the find_ibus_address branch May 9, 2024 21:33
@symphorien
Copy link
Contributor Author

What went wrong when you run pmim ?

when I run cargo run it runs fine but I don't know how to tell ibus to use it. Actually I'm not really interested in pmim, I have my own implementation of IBusEngine and I would like to know how to configure ibus to use it: what key combination should I type so that IBusEngine::process_key_event is triggered? (Note that I'm not really familiar with ibus, that may be a dumb question)

@secext2022
Copy link
Contributor

See here: https://github.com/fm-elpac/pmim-ibus/blob/main/doc/%E5%AE%89%E8%A3%85.md#21-%E9%80%82%E7%94%A8%E4%BA%8E%E5%A4%A7%E9%83%A8%E5%88%86-gnulinux-%E5%8F%91%E8%A1%8C%E7%89%88%E6%9C%AC-%E6%89%8B%E5%8A%A8%E9%85%8D%E7%BD%AE


Add a file to /usr/share/ibus/component/pmim_ibrus.xml:

<?xml version="1.0" encoding="utf-8" ?>
<!-- /usr/share/ibus/component/pmim_ibrus.xml -->
<component>
  <name>org.fm_elpac.pmim</name>
  <description>PMIM (ibus)</description>
  <exec>/path/to/ibrus</exec>
  <version>0.1.0</version>
  <author>secext2022</author>
  <license>GPL</license>
  <homepage>https://github.com/fm-elpac/pmim-ibus</homepage>
  <textdomain>pmim-ibus</textdomain>

  <engines>
    <engine>
      <name>pmim</name>
      <language>zh_CN</language>
      <license>GPL</license>
      <author>secext2022</author>
      <layout>default</layout>
      <longname>胖喵拼音</longname>
      <description>胖喵拼音输入法 (ibus)</description>
      <rank>99</rank>
      <symbol>喵</symbol>
      <icon_prop_key>InputMode</icon_prop_key>
      <textdomain>pmim-ibus</textdomain>
    </engine>
  </engines>
</component>

change <exec>/path/to/ibrus</exec> to the path of ibrus binary.

Then restart ibus-daemon.
Then you can add this new input method in ibus-setup.


You should not run ibrus directly, but switch input method with ibus.
Then ibus-daemon will run ibrus for you.

@secext2022
Copy link
Contributor

When ibus-daemon start, it will read configuration files from /usr/share/ibus/component/*.xml, and register <component> and <engine> (input method).

Then switch input method with ibus, ibus will run binary as child process from <component> <exec> path.
Then ibus will send key event to the <engine>.

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

Successfully merging this pull request may close these issues.

2 participants