[Bug Fix] :: Fix Spare layout feature on Wayland

I like the idea of sponsored bugfixes.
One of cool feature that I use is Spare layout.

For configurations with more than two keyboard layouts it allows switching between N latest using single keyboard shortcut.

When used together with per-layout shortcut it allows something like followed (assuming that Meta+3 is configured to trigger layout 3 and Caps-Lock is configured to cycle between layouts)

  • layout 1 is active
  • Caps Lock switches to layout 2
  • Caps Lock switches to layout 1
  • Caps Lock switches to layout 2
  • Meta+3 switches to layout 3
  • Caps Lock switches to layout 2 (latest used)
  • Caps Lock switches to layout 3
  • Caps Lock switches to layout 2

Unfortunately this doesn’t work with Wayland.

Bug: 455431 – Spare layout not working on Wayland

I’ll donate $50 USD once fix is merged.

2 Likes

This has basically just been implemented with Add toggle previous keyboard layout shortcut (!1722) Ā· Merge requests Ā· Plasma / Plasma Desktop Ā· GitLab.

1 Like

Excellent!.

Author of pull requests don’t want to get that $50.

I think I’ll add my $50 to one of other bug reports

1 Like

Hey @dion ,

is it really working like this for you in X like you described it above? Because from what I understood (and what I am experiencing), after you press on Meta+3, it will not toggle between 2 and 3, but it will toggle between 1 and 3.

BR
Mihail

Hi,

Sorry for late response… Yes. I think you are right. Most likely it’ll switch between 1 and 3 on X11. But personally I don’t care about this.

My usual use case is to do followed:

  • Often 1-2
  • Sometimes 1-3
  • VERY rarely 2-3

I’m fine with pressing a few times Meta+1,3 to ā€˜warm up’ list of latest layouts :slight_smile:

I finally upgraded to Plasma 6 (since it’s now available in Debian Unstable). And I was able to configure ā€˜acceptable’ behavior. Unfortunately it’s much more difficult now… I can configure ā€˜Caps Lock’ to switch layouts but unfortunately Caps key also toggles ā€œCaps Lockā€ā€¦ The only way to fix it was to remap Caps Lock to F13 using GitHub - katie-jones/xkeyboard-config-f13: Modify xkb configuration files to add a layout option mapping the Caps Lock key to F13. (with a few more changes to make it work with Plasma on Debian). Then I was able to map F13 as ā€œSwitch to last used layoutā€. Unfortunately it requires changes to xkb-data package…

PS. I still want to ā€˜sponsor’ coffee for this… So I’m adding $50 more for this. So it’ll be total $100 to make it work without this F13 hack.