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. π
- typeof:
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. π«Ά
- typeof:
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 β¬οΈ
- typeof:
numlockβ display the number lock state.- typeof:
bool - default:
false
- typeof:
capslockβ display the caps lock state.- typeof:
bool - default:
false
- typeof:
scrolllockβ display the scroll lock state.- typeof:
bool - default:
false
- typeof:
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 π
- typeof:
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 runningsudo libinput debug-events --show-keycodesπ΅οΈββοΈ
- typeof:
expandβ enables this module to consume all left over space dynamically.- typeof:
bool - default:
false - it will literally eat the leftover space. slay. π
- typeof:
π FORMAT REPLACEMENTS π
the little magic words you can drop into your format:
{name}β Caps, Num, or Scroll. π{icon}β Icon, as defined informat-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
- ubuntu resolute: waybar 0.15.0-1 Β· MIT
- ubuntu stonking: waybar 0.15.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms