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: the content configuration option is a template. sway-xkb instantiates 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 identifier
  • layout (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: use swaymsg -t get_inputs to 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 both left-spacing and right-spacing at 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