yambar-modules-sway-xkb(5)
π yambar-modules-sway-xkb β from the File Formats Manual, bestie
okay so picture this: you've got multiple keyboard layouts and you want your bar to actually tell you which one is live rn. that's the whole gig. this is the sway-xkb module, page yambar-modules-sway-xkb(5), and she is lowkey iconic.
β¨ NAME β¨
sway-xkb β this module monitors your input devices' active XKB layout π
πΈ DESCRIPTION πΈ
so basically this module uses the Sway extensions to the I3 IPC API to keep an eye on your input devices' active XKB layout. the catch? it needs Sway to actually be running. no Sway, no vibes. π
heads up bestie: thecontentconfiguration option is a template.sway-xkbinstantiates a particle list from it, and each item in that list is instantiated from the template and represents one input device. so it's like a little particle factory, one per device. π§
π¦ TAGS π¦
each one of these is available for you to use in your templates, iykyk:
id(string) β input device identifierlayout(string) β the input device's currently active XKB layout
π CONFIGURATION π
the deets, one option at a time:
identifiers(list of strings) β required, yes ma'am. these are the identifiers of the input devices to monitor. pro tip straight from the page: useswaymsg -t get_inputsto see what devices are available. πcontent(particle) β required. a particle template; each existing input device will be instantiated with this template. β¨left-spacing(int) β optional. space, in pixels, on the left side of each rendered input device.right-spacing(int) β optional. space, in pixels, on the right side of each rendered input device.spacing(int) β optional. short-hand for setting bothleft-spacingandright-spacingat once. efficiency queen. π
π EXAMPLES π
here's the look, copy it and slay:
bar:
left:
- sway-xkb:
identifiers:
- 1523:7:HID_05f3:0007
- 7247:2:USB_USB_Keykoard
spacing: 5
content: {string: {text: "{id}: {layout}"}}
(yes, Keykoard. it's in the original, we don't touch it, we respect it. π«Ά)
π SEE ALSO π
go read these too, they're all part of the family:
and that's the whole page, bestie β no notes. this one's from the File Formats Manual, dated 2024-04-22, and it's yambar-modules-sway-xkb(5) forever and always. periodt. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- opensuse-leap 16.0: yambar 1.11.0-bp160.1.14 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms