Skip to content

fix(niri): Super+Space switches keyboard layout (us/ar)#13

Merged
UnbreakableMJ merged 1 commit into
mainfrom
fix/niri-layout-switch
Jun 25, 2026
Merged

fix(niri): Super+Space switches keyboard layout (us/ar)#13
UnbreakableMJ merged 1 commit into
mainfrom
fix/niri-layout-switch

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Problem

In Niri, Super+Space did not change the writing language. The Niri config relied solely on the xkb option grp:ctrl_space_toggle, but:

  1. That's bound to Ctrl+Space, not Super+Space.
  2. More fundamentally, Niri grabs key events for its own binds before xkbcommon's group-toggle action fires, so grp:*_toggle options are a no-op under Niri (they do work under X11/LeftWM).

Fix

  • Add Niri's native action: Mod+Space { switch-layout "next"; } (Mod = Super) with a hotkey-overlay title.
  • Annotate the xkb block explaining the X11-vs-Niri difference.
  • X11 paths (home.keyboard, services.xserver.xkb) keep grp:ctrl_space_toggle — it genuinely works under LeftWM.

Verification

  • nix eval of the toplevel drvPath — passes.
  • niri validate on the rendered config.kdlconfig is valid.

🤖 Generated with Claude Code

Niri grabs key events for its own binds before xkbcommon's group-toggle
action fires, so the xkb `grp:ctrl_space_toggle` option — which does switch
layouts under X11/LeftWM — was a no-op in Niri. Super+Space did nothing.

Add Niri's native `switch-layout "next"` action on Mod+Space (= Super+Space)
and document the X11-vs-Niri difference at the xkb block. The X11 paths
(home.keyboard, services.xserver.xkb) keep grp:ctrl_space_toggle untouched.

Verified with `niri validate` (config is valid).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@UnbreakableMJ UnbreakableMJ merged commit 15a973b into main Jun 25, 2026
1 check passed
@UnbreakableMJ UnbreakableMJ deleted the fix/niri-layout-switch branch June 25, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant