IBus: Difference between revisions
→Input methods: Remove snippet about nix-repl which lacks context for loading nixpkgs and is inferior to the second option of viewing the option docs. |
m →Installation: Format code block (using nixfmt-rfc-style) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
== Installation == | == Installation == | ||
Enabling IBus is described in the [https://nixos.org/nixos/manual/index.html#module-services-input-methods-ibus manual]. | Enabling IBus is described in the [https://nixos.org/nixos/manual/index.html#module-services-input-methods-ibus manual]. To enable it is as follows: | ||
{{file| | {{file|3={ pkgs, lib, ... }: | ||
{pkgs, lib, ...}: | |||
{ | { | ||
i18n.inputMethod = { | |||
enable = true; | |||
type = "ibus"; | |||
ibus.engines = with pkgs.ibus-engines; [ | |||
# Your engines here | |||
} | ]; | ||
</ | }; | ||
}|name=/etc/nixos/configuration.nix|lang=nix}}Available engines are listed under the <code>pkgs.ibus-engines</code> attribute set. The list of available engines can be viewed in the documentation for the {{nixos:option|i18n.inputMethod.ibus.engines}}option. | |||
After rebuilding and switching to the new configuration, you still need to logout from your session and login again for ibus to work correctly. | |||
== Troubleshooting == | |||
=== Custom emojis === | === Custom emojis === | ||
Custom emojis can be added to the emoji selection dialog of IBus. This can be used to workaround the fact that GTK does not support compose rules which output more than one unicode codepoint. Here an example [[Home Manager]] | Custom emojis can be added to the emoji selection dialog of IBus. This can be used to workaround the fact that GTK does not support compose rules which output more than one unicode codepoint. Here an example [[Home Manager]] snippet. | ||
{{file| | {{file|3={ pkgs, lib, config, ... }: | ||
{ pkgs, lib, config, ... }: | |||
let | let | ||
/* define here the list of desired favorite emoji */ | /* define here the list of desired favorite emoji */ | ||
Line 39: | Line 35: | ||
favorites = mkArray type.string (lib.attrValues fav); | favorites = mkArray type.string (lib.attrValues fav); | ||
}; | }; | ||
} | }|name=~/.config/home-manager/home.nix|lang=nix}} | ||
Then, | Then, pressing <code>Ctrl+Shift+e</code> and then typing <code>shrug</code>, then hitting <code>Space</code> and <code>Return</code> will insert <code>¯\_(ツ)_/¯</code>. | ||
== See also == | == See also == |
Latest revision as of 00:51, 10 July 2025
IBus is a bus for various input methods.
Installation
Enabling IBus is described in the manual. To enable it is as follows:
{ pkgs, lib, ... }:
{
i18n.inputMethod = {
enable = true;
type = "ibus";
ibus.engines = with pkgs.ibus-engines; [
# Your engines here
];
};
}
Available engines are listed under the pkgs.ibus-engines
attribute set. The list of available engines can be viewed in the documentation for the i18n.inputMethod.ibus.engines
option.
After rebuilding and switching to the new configuration, you still need to logout from your session and login again for ibus to work correctly.
Troubleshooting
Custom emojis
Custom emojis can be added to the emoji selection dialog of IBus. This can be used to workaround the fact that GTK does not support compose rules which output more than one unicode codepoint. Here an example Home Manager snippet.
{ pkgs, lib, config, ... }:
let
/* define here the list of desired favorite emoji */
fav = {
shrug = ''¯\_(ツ)_/¯'';
"markdown-shrug" = ''¯\\\_(ツ)\_/¯'';
flip = ''(╯°□°)╯︵ ┻━┻'';
};
in
{
dconf.settings."desktop/ibus/panel/emoji" = with lib.hm.gvariant; {
favorite-annotations = mkArray type.string (lib.attrNames fav);
favorites = mkArray type.string (lib.attrValues fav);
};
}
Then, pressing Ctrl+Shift+e
and then typing shrug
, then hitting Space
and Return
will insert ¯\_(ツ)_/¯
.