C ABI plugin system - #2573
C ABI plugin system#2573
Conversation
|
This could be a really nice addition! |
a119cee to
33072b7
Compare
|
Sorry for the delay, I got carried away by other projects I think this PR is ready to be reviewed / merged ! The current ABI may not be perfect yet, but it's definitely usable and can always be improved later using feedback from custom module devs. There's an example module located in Some key points for maintaining and upgrading the CFFI ABI:
|
|
Nice, look pretty simple for a first iteration, thx! |
|
Done ! The wiki page is here: https://github.com/Alexays/Waybar/wiki/Module:-CFFI-(unreleased) The file resources/custom_modules/cffi_example/waybar_cffi_module.h documents the symbols to define for a module to be loaded. I'm not sure it should be stored in the example directory, but I'm not sure where it belongs to |
Hi !
I played around with waybar a bit, and developed a quick proof of concept for a C ABI plugin system, that could allow people to develop more complex waybar modules, without modifying waybar itself.
The idea is to have waybar allocate a GTK container for the cabi plugin, and send its pointer to the plugin, that takes care of populating the widget as needed. The C ABI is very handy because GTK is in C and almost most languages can generate a C ABI (C++, rust, python, ...) and call GTK functions.
My end goal is to develop a custom system monitor module, that displays CPU, IO and network activity in a very compact manner (eventually with graphs) !
As I said, this currently a PoC and needs to be worked on to improve the ABI, add more features and config options, ...
I would like to get your opinion on the C ABI idea, and if it is worth spending more time on this PR
To try it out:
cd cabi_example && meson build && meson compile -C build{ "modules-center": ["cabi/c_example"], "cabi/c_example": {"path": "cabi_example/build/libwaybar_cabi_c_example.so"} }./build/waybar -c cabi_config