waybar-keyboard-state(5)

πŸ’– waybar-keyboard-state(5) πŸ’–

okay bestie, welcome to waybar-keyboard-state, the section 5 manual page for the keyboard-state module. it's filed under File Formats Manual, it's giving very ✨ niche utility ✨, and it is lowkey the most satisfying little module in the whole bar. let's get into it 🫢


🌸 NAME 🌸

waybar β€” keyboard-state module πŸ’…


✨ DESCRIPTION ✨

so what does this thing even do? the keyboard-state module shows you the state of three lil lock keys: number lock, caps lock, and scroll lock. that's it, that's the whole job, and it does it flawlessly. main character behavior fr fr. πŸ‘‘

🚨 real talk though: you must be a member of the input group to use this module. no group membership, no module. periodt.

πŸŽ€ CONFIGURATION πŸŽ€

here's every option, no notes, nothing skipped, iykyk πŸ’–

  • interval β€” Deprecated, this module uses an event loop now, so the interval literally has no effect. it's just... here. vibing. doing nothing. πŸ’€
    • typeof: integer
    • default: 1
    • it used to be the interval, in seconds, to poll the keyboard state. used to. πŸ™ˆ
  • format β€” the format, aka how the information should actually be displayed.
    • typeof: string|object
    • default: {name} {icon}
    • if it's a string, that same format gets used for all keyboard states. if it's an object, the fields "numlock", "capslock", and "scrolllock" each specify the format for the corresponding state. any states you don't specify just fall back to the default format. so generous of you. 🫢
  • format-icons β€” based on the keyboard state, the corresponding icon gets selected. ✨
    • typeof: object
    • default: {"locked": "locked", "unlocked": "unlocked"}
    • heads up: the same set of icons is used for number, caps, and scroll lock, but the icon is selected from that set independently for each one. see icons below bestie ⬇️
  • numlock β€” display the number lock state.
    • typeof: bool
    • default: false
  • capslock β€” display the caps lock state.
    • typeof: bool
    • default: false
  • scrolllock β€” display the scroll lock state.
    • typeof: bool
    • default: false
  • device-path β€” which libevdev input device to show the state of.
    • typeof: string
    • default: chooses first valid input device
    • libevdev devices can be found in /dev/input. and the device should support number lock, caps lock, and scroll lock events, otherwise what are we even doing here 😭
  • binding-keys β€” customize the key to trigger this module.
    • typeof: array
    • default: [58, 69, 70]
    • you can find the key number in /usr/include/linux/input-event-codes.h, or by running sudo libinput debug-events --show-keycodes πŸ•΅οΈβ€β™€οΈ
  • expand β€” enables this module to consume all left over space dynamically.
    • typeof: bool
    • default: false
    • it will literally eat the leftover space. slay. πŸ“

🌈 FORMAT REPLACEMENTS 🌈

the little magic words you can drop into your format:

  • {name} β€” Caps, Num, or Scroll. πŸ‘‘
  • {icon} β€” Icon, as defined in format-icons. ✨

πŸ¦‹ ICONS πŸ¦‹

the following format-icons can be set:

  • locked: will be shown when the keyboard state is locked. default "locked".
  • unlocked: will be shown when the keyboard state is not locked. default "unlocked".

🧚 EXAMPLE: 🧚

copy this exactly, character for character, i'm not kidding πŸ’…

"keyboard-state": {
     "numlock": true,
     "capslock": true,
     "format": "{name} {icon}",
     "format-icons": {
          "locked": "",
          "unlocked": ""
     }
}

πŸ’œ STYLE πŸ’œ

all the CSS selectors you can style, in order, obsessed with them:

  • #keyboard-state
  • #keyboard-state label
  • #keyboard-state label.locked
  • #keyboard-state label.numlock
  • #keyboard-state label.numlock.locked
  • #keyboard-state label.capslock
  • #keyboard-state label.capslock.locked
  • #keyboard-state label.scrolllock
  • #keyboard-state label.scrolllock.locked

and that's the page bestie πŸ₯Ή tysm for reading, fr fr. this was waybar-keyboard-state(5) from the File Formats Manual, dated 2026-02-08. go forth and lock your caps, or don't, live your truth. no cap. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ‘‘πŸŒˆβ­πŸ’œ

πŸ“¦ where this page comes from