Skip to content

feat(keyboard_locks): add Caps/Num/Scroll lock indicators#755

Open
noirbizarre wants to merge 1 commit into
MalpenZibo:mainfrom
noirbizarre:feat/keyboard-locks
Open

feat(keyboard_locks): add Caps/Num/Scroll lock indicators#755
noirbizarre wants to merge 1 commit into
MalpenZibo:mainfrom
noirbizarre:feat/keyboard-locks

Conversation

@noirbizarre
Copy link
Copy Markdown
Contributor

@noirbizarre noirbizarre commented May 15, 2026

Summary

Adds a new bar module displaying Caps/Num/Scroll Lock state, with click-to-toggle support.

  • Reads LED state from /dev/input/event* via evdev (compositor-agnostic — works on both Hyprland and Niri).
  • Hotplug-aware via a udev monitor on the input subsystem.
  • Clicking an indicator toggles the corresponding lock through a lazily-created /dev/uinput virtual keyboard. If /dev/uinput cannot be opened, the display still works and clicks become no-ops with a single warning.
  • Per-lock config: enabled, visibility (ActiveOnly default / AlwaysVisible), and an optional icon override (Nerd Font glyph or plain text). Default glyphs bundled (no extra font install required).
  • Module renders the three indicators flush inside a single rounded island (no inner pill rounding), each with a per-icon hover highlight that matches the rest of the bar.

Permissions

Both /dev/input/event* and /dev/uinput are typically owned by the input group, so a single sudo usermod -aG input \"\$USER\" is enough. The user docs cover the manual udev-rule fallback for systems where /dev/uinput is not in the input group by default.

Testing

  • make check (fmt + cargo check + clippy -D warnings) is clean.
  • Verified manually with bar_style = \"Islands\" and all three locks set to AlwaysVisible: glyphs render flush inside one island, click toggles the corresponding lock, LED state updates after the kernel synthesizes the press.
  • Verified that without /dev/uinput access the display still updates from external lock presses; clicks log a single warning and no-op.

Docs

website/docs/configuration/modules/keyboard.md adds a new "Keyboard Locks" section. Versioned docs under website/versioned_docs/ are untouched per the project policy.

Screenshots

Screenshot-2026-05-16-030719 Screenshot-2026-05-16-030747

Notes

  • I've been using it until now without any issue.
  • I've been using AI to code this, I prefer to be transparent on this (and hope this is not an issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant