Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5120

Beginners • Re: Keyboard Layout Handler dissapear on bookworm

$
0
0
Good news, forum!! I got all three parts working, at least in Proof-of-Concept status!

The first part, tracking the current state, was already working. The second part, sending a DBus signal, proved to be extremely easy, thanks to the wfpanelctl utility that comes with wf-panel-pi. The third part is indeed a GDK wf-panel-pi plugin widget that shows the current language layout. It proved quite easy to scoop code from other wf-panel-pi plugins to make this widget catch and use the DBus event that the kbdd plugin sends. All in all, the thing works nicely, and looks like this:

Image Image

I know it does not reach the beauty of a Da Vinci design, but yes, the widget updates every time i press Alt-Shift (the toggle combo in my configuration) *and* , thanks to kbdd, whenever I switch from window to window, by either clicking, or pressing Alt-TAB or Super-TAB, or by clicking on a panel task label to select it.

Now, there are still a few caveats:
  • because the panel plugin only updates by receiving a DBus event, initially it shows nothing; this obviously needs fixing
  • the widget does switch layouts; in other words, it is not (or at least, not yet) an on-screen keyboard handler, it is just an indicator
  • my code is still awfully dirty for posting and it needs quite a few days of cleanup; please bear with me while I do this boring thing
  • funny bug: if you click on the widget, kbdd switches the keyboard layout to the one of the panel; thus, my keyboard layout widget shows the language of the panel, which is now what one would expect
On the positive side, the kbdd plugin, which now reads the keyboard layout options from wayfire.ini, was made smart enough to reload layout options upon wayfire.ini changes, so if you decide e.g. to add French or Russian in the middle of your Wayfire session by adding a new layout language to the [input]->xkb_layout setting in wayfire.ini while running Wayfire, it all works like a charm (yes, Wayfire was already able to update on-the-spot the keyboard layout list, and so does now my version of the kbdd plugin).

My next steps will be to find workarounds for the above issues and cleanup the code. After that, I will post, so you can try building. I will send pull requests to the maintainers, keeping though a small basket as to whether they will accept to merge them into their code repositories which will allow this work to eventually become part of the distros. What happens most of the times is that code maintainers get triggered by the pull request to find a better way of doing it themselves. To me, that's equally valuable to adopting the proposed code. Let us wait until that time, and see what happens.

Statistics: Posted by avarvit — Sun Jan 21, 2024 6:25 am



Viewing all articles
Browse latest Browse all 5120

Trending Articles