I’ve run into a issue on my Manjaro KDE Wayland setup. I want to use the grave/backquote key (`) to toggle between English (US) and Thai layouts, but it only ever switches in one direction (US → TH) and then stops working until I manually switch back. Under X11 this “grp:grave_switch” option worked perfectly, but under Wayland it seems to be broken.
event2 KEY_GRAVE (41) pressed → released
//That mean my keyboard Grave-key button is working in Wayland
Under X11 everything toggles cleanly back-and-forth; under Wayland it only fires the “next‐group” once, then reverts to emitting a literal backtick instead of cycling back.
What I suspect
This looks like a limitation or bug in xkb (libxkbcommon/Wayland). I’ve even located similar upstream reports/update
Has anyone else on Manjaro KDE Wayland run into this “one-way” grave-key toggle (or similar)?
Is this a bug of xkb or wayland. and I need to wait for the upstream?
PS.
Thanks in advance. I’m still new to Linux and Manjaro (4 Years). This is beyond my knowledge
Also In my country (Thailand) we use Grave-key is change to keyboard input (US ↔ TH) so if someone can fixed this problem it’s very helpful for Linux in Thailand community (In Windows OS we use grave-key for switch keyboard input)
Thanks for including that, because by default there’s no option to use grave for changing layouts.
So this is your own project?
I think you’re better off asking the devs for xkeyboard-config. Perhaps they’d even be willing to add it as a default option.
Alternatively there’s a way to override the files owned by xkeyboard-config, but it only works with Wayland.
If memory serves there are two locations you can use, $XDG_CONFIG_DIR/xkb/ (aka ~/.config/xkb) and /etc/xkb. This is a blog post about it from one of the xkeyboard-config devs.
EDIT:
I’ve had a look at your repo. As I’m sure you’ve found out, those files are owned by xkeyboard-config and will be overwritten every time that package gets updated. Overriding is better, but only works for Wayland.
If lots of people use it, then the proper way would be to get it included in xkeyboard-config.
However the rules files in their repo are intermediate files and won’t match what you’ve done so far.
that’s code really old and it’s been used in Linux Thailand comminity for a long time (since ~2010), the original link is already gone. So I maintenance it and put on github. (previously hosted it on my own website)
I’m still new to open source community. Also I don’t have so much knowledge how to do request properly to make that grave-key to be in main xkeyboard-config since i don’t know it meet the requirement or not. and right now in windows 11. it’s quite hard to setup grave key for Thai user. since Windows 11 is now remove Control panel (The article how to setup grave key in Windows OS https://touchpoint.in.th/change-input-language-windows11/)
I’d really appreciate it if you could help forward this to the developers of xkeyboard-config, since I don’t have an account on freedesktop.org, and honestly, that site feels a bit scary to me. (If you think this is ok to be in the default config of xkeyboard-config)
Lastly. I’m doing more debug of this issuse
Try to reproduce this problem on 25.0.1 and 25.0.2
I’ll post the result here after I finished my testing
Thank you,
Tackle
Hello, Manjaro users & moderator
I’ve test the previous Manjaro version and found out that…
24.2.1 → This version is working fine
25.0.0 → This version is break my setup
//Create new reply due to previously. I write post with wrong version of Manjaro.
//also I’ve edited the typo version first post
All the package version refer by Original Manjaro KDE ISO from sourceforge
As I said. x11 is working fine. but break in Wayland
any help or advice is appreciated
I played around and got it working. Here’s the updated version, hopefully I remembered everything
Please test it and let me know if it works for you, if so I’ll create a pull request so you can easily merge it into your repo.
In time it will need updating again, in fact it should be updated every time xkeyboard-config modifies one of those files. If you can say for sure that lots of people use it then it should probably be added into xkeyboard-config, but I’m not sure they’ll like it as it’s replacing a normal key.
It works with any layouts not just US and TH, so perhaps update the description to be more accurate.
Grave Key Layout Switcher — Switch layouts with the grave (`) key on X11 and Wayland.
Yes, i’ve test your code and it’s working perfectly.
That’s a magic, please create Pull requests that would be amazing
Also, maybe you have to edit “script.sh” a little bit. since you have removed “xkb”
Maybe in the future i’ll setup some “git action” to perform auto update for this (just a hotfix for now, or until xkeyboard-config come with grave-key as default)
PS. This problem make me up all night until 5:00 am. try to find solution. I’m fight with xkb-config all night
PS #2. In Windows OS. Yes. We use grave-key for a long time, since I was born (from the pic we need to select Grave-Accent on the left. and on the right Not Assigned) that pics from the internet. I don’t use Windows any more
This makes it easier for people to move to Linux, especially if they’re used to using the grave key to switch keyboard layouts.
Great, I’ve created a pull request which also includes
Yep, it was late and I forgot about that one.
I’ve modified it so you can optionally install it just for Wayland, the benefit is that you only need to do it once (updates won’t overwrite it).
# only use one of these
./script.sh # install for both X11 and wayland
./script.sh wayland # install for wayland only
I haven’t tested it though, so let me know if it needs more work.
Yeah it can take a while, it’s not a particularly easy system to learn.
It took me 2-3 hours, and I’ve done this kind of thing before, but in my defence I had to refresh my memory and I was doing everything manually (no script).
Here was a small problem if user didn’t define the “wayland” option, then the script will error as below.
Run → sudo ./script.sh Output → ./script.sh: line 18: $1: unbound variable
If you prefer to fix the script first, then create pull request is ok. or you can create pull request right away, then i’ll fix that problem and I’ll take care of the rest. since you already fixed the hardest part already
Sorry, didn’t see that you already created pull request
I hope someone, or maybe you can contribution the grave-key to xkeyboard-config so Linux user can have “Grave-key” for keyboard layout switch out of the box. (with out manual install this script) I’m not good enough to contribution on freedesktop.org