gnoblin.configure.input_sources
Set the active input sources with gnoblin.configure {input_sources = {...}}. On reload, this replaces the active source list in memory. Remove the table to restore GNOME's session sources.
sourcesis required. It is an array of records with atypeand a nonemptyid.sources[].typeaccepts"xkb"for a keyboard layout or"ibus"for an input method.sources[].idis an installed XKB layout ID or IBus engine ID, depending ontype.per_windowis optional and defaults tofalse. Set it totrueto remember a different source for each window.
Choose an ID
Use the exact source ID, not its display name. For example, "us+intl" selects the US International variant. Available layouts and variants depend on the XKB data installed on your system.
| Source | Example ID | Meaning |
|---|---|---|
| US English | "us" | The base US layout. |
| British English | "gb" | The base UK layout. |
| US International | "us+intl" | The US layout with the intl variant. |
| Anthy | "anthy" | An IBus Japanese input engine; it must be installed. |
Find layouts and variants in Settings → Keyboard → Input Sources. GNOME's GnomeXkbInfo API lists the layout IDs GNOME recognizes. The XKB introduction explains how layouts and variants combine. For an overview of available layouts, see the XKB layout gallery.
To find installed IBus engine IDs, run:
ibus list-engine --name-onlySee the ibus command reference for the engine-list command.
Configure the sources
This example lets you switch between the base US and UK layouts:
gnoblin.configure {
input_sources = {
sources = {
{type = "xkb", id = "us"},
{type = "xkb", id = "gb"},
},
per_window = false,
},
}Use the layout-plus-variant ID for a variant. An IBus ID must name an engine installed on your system:
gnoblin.configure {
input_sources = {
sources = {
{type = "xkb", id = "us+intl"},
{type = "ibus", id = "anthy"},
},
per_window = false,
},
}This setting selects layouts or input methods; it does not set XKB options. Configure those separately with input.keyboard.xkb_options.
Type definition
The IDs are installation-dependent strings. ? marks an optional field.
gnoblin.configure {
input_sources = {
sources = {{type = "xkb" | "ibus", id = string}, ...},
per_window = boolean?,
},
}