On 5/9/21 7:50 PM, Sampson Fung wrote:
Thank you very much for the hard works. I find sway very usable even with a 10 years old notebook with only 2GB of memory.
My objective is trying to enable Chinese Input Method "cangjie" (for the default terminal and for Firefox) using Internet Searchable hints while following the default sway config as much as possible (or following the recommended config by the SWAY SIG as close as possible.)
I have no experience with Chinese input methods, but I'll try to answer to the best of my knowledge.
As far as I'm aware, the only IME fully supporting sway is fcitx5; ibus support for input-method-unstable-v2[1] is still WIP with nothing usable at the moment. fcitx5 seems to have "cangjie" data available via `fcitx5-chinese-addons` and `libime-data` packages. `fcitx5-rime` could be an alternative configuration, but it'll take more manual steps as we don't provide `rime-cangjie` dictionaries in Fedora. I'm really out of my depth here, so if you have questions on configuring the specific input method I suggest to reach out to Qiyu Yan (@yanqiyu), the maintainer of fcitx5 packages in Fedora.
Now, onto the sway specific instructions.
You'll need sway 1.6 and fcitx5-5.0.8 from updates-testing[2]. You can start IME service with `exec fcitx5` command in the sway configuration file. The tricky part is getting apps to use IME. You need to ensure that all the following variables are set before you launch sway:
INPUT_METHOD=fcitx GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx
You've mentioned that you run sway from a console session, so adding these to the shell config (.bashrc, .zshrc, etc.) should be sufficient. That would also work with `sddm` display manager (but doesn't work with `gdm`). I'll stop here, since the topic of setting sway environment is complicated and writing the document on that is on my TODO list.
I will start with Fedora 34 Workstation, and replicate to Silverblue 34.
Currently, what I have done is:
sudo systemctl set-default multi-user.target sudo dnf install sway
After login in Console, I just run manually run sway
Q1. What is the preferred way to start testing sway? (with systemd integration)
Just make sure that `sway-systemd` is installed (it's a recommended dependency of `sway` package so it's there if you haven't disabled weak dependencies) and the configuration files from `/etc/sway/config.d/*` are sourced. There's no preferred way to start sway; either running it from the console or using display manager is supported.
Q2. Where can I find the "recommended" sway config by the SIG?
There's an upstream configuration file installed at `/etc/sway/config` and the only change we apply is to change background image to the Fedora defaults. There's also a couple of config snippets in the `/etc/sway/config.d` directory provided via `sway-systemd` package, and that's the full extent of our customizations.
[1]: https://github.com/ibus/ibus/issues/2182 [2]: https://bodhi.fedoraproject.org/updates/FEDORA-2021-7798845ee1