I use my Rpi 5 (and in the past, RPi 4 and 400) for general desktop work. Being Greek, I have to work in two languages. With the advent of Wayland as a successor of X11, the good old "kbdd" functionality of tracking, displaying and modifying the keyboard layout (language) via a taskbar widget is gone for good, and is not easy to re-instate, because Wayland has been designed purposely to "leave this task to compositors". Among compositor ecosystems, I have found this functionality to be available in sway, however RPiOS comes with wayfire and labwc instead; and anyway, I believe it is a bit too much to ask a user to switch away to a completely new compositor ecosystem just because this detail is missing. Thus, I decided to build this myself.
Two components are required to make the thing work: one is the widget itself, and another one is some add-on functionality in the compositor, where the add-on and the widget communicate over e.g., sockets, files or DBus. In this older thread viewtopic.php?t=367873, I had posted links to a wf-panel-pi version and a wayfire plugin that provide the display and switching functionality. The times they are-a-changing, and since then, two (good!) things have happened: wayfire has given way to labwc as the preferred compositor for RPiOS, and wf-panel-pi has also obtained a dev package, thus allowing plugins to be developed and built independently of the main wf-panel-pi's code tree.
Adapting to these changes, I have now provided my "wf-panel-pi-kbdlayout" code as a standalone wf-panel-pi plugin, and, in addition to my older "wayfire-kbdd-plugin", I have now provided a "wlroots-kbdd" wrapping library to make labwc able of reporting keyboard layout (language) changes that the user performs via the keyboard switch combo (e.g., left-alt-shift) to the kbdlayout widget, and switching the current layout after DBus messages it receives from the kbdlayout widget. (Note that, since labwc does not currently support plugins, wrapping a library was the only hack I could find to make this work. Please do not tell me it is not elegant, it is ugly, etc. I know.)
Any multi-language users who want to try this are welcome to compile and try the code. Note that in this version, no official RPiOS package binaries are affected, and all my code is in the form of add-ons (wayfire plugin, wf-panel-pi widget, labwc add-on library), allowing the main system components (wf-panel-pi, wayfire and labwc) to be updated as usual. Compiling my code will require some elementary skills of working with source, like installing git, dependency libraries, meson, ninja, cloning the repos, running meson, etc., as well as some minor configuration file changes. I am giving some instructions in the README files of my repos, though a complete tutorial is not in my scope for this contribution.
Two components are required to make the thing work: one is the widget itself, and another one is some add-on functionality in the compositor, where the add-on and the widget communicate over e.g., sockets, files or DBus. In this older thread viewtopic.php?t=367873, I had posted links to a wf-panel-pi version and a wayfire plugin that provide the display and switching functionality. The times they are-a-changing, and since then, two (good!) things have happened: wayfire has given way to labwc as the preferred compositor for RPiOS, and wf-panel-pi has also obtained a dev package, thus allowing plugins to be developed and built independently of the main wf-panel-pi's code tree.
Adapting to these changes, I have now provided my "wf-panel-pi-kbdlayout" code as a standalone wf-panel-pi plugin, and, in addition to my older "wayfire-kbdd-plugin", I have now provided a "wlroots-kbdd" wrapping library to make labwc able of reporting keyboard layout (language) changes that the user performs via the keyboard switch combo (e.g., left-alt-shift) to the kbdlayout widget, and switching the current layout after DBus messages it receives from the kbdlayout widget. (Note that, since labwc does not currently support plugins, wrapping a library was the only hack I could find to make this work. Please do not tell me it is not elegant, it is ugly, etc. I know.)
Any multi-language users who want to try this are welcome to compile and try the code. Note that in this version, no official RPiOS package binaries are affected, and all my code is in the form of add-ons (wayfire plugin, wf-panel-pi widget, labwc add-on library), allowing the main system components (wf-panel-pi, wayfire and labwc) to be updated as usual. Compiling my code will require some elementary skills of working with source, like installing git, dependency libraries, meson, ninja, cloning the repos, running meson, etc., as well as some minor configuration file changes. I am giving some instructions in the README files of my repos, though a complete tutorial is not in my scope for this contribution.
- The code for wf-panel-pi-kbdlayout widget is here: https://github.com/avarvit/wf-panel-pi-kbdlayout
- The code for the wayfire plugin is here: https://github.com/avarvit/wayfire-kbdd-plugin
- The code for a wloots-wrapping library for labwc is here: https://github.com/avarvit/wlroots-kbdd
Statistics: Posted by avarvit — Tue Aug 26, 2025 5:41 am