Files
dotfiles/dot_config/waybar/waybar.wiki/Module:-CFFI.md
s0wlz (Matthias Puchstein) 8018b53353 feat: finalize migration to chezmoi and modernize configuration logic
- Modularize Hyprland config into hyprland.d/
- Implement infinitely scalable monitor/workspace logic using templates and loop-based data structures
- Consolidate host-specific configs (hyprlock, hyprpaper, waybar) into single templates
- Resolve waybar symlink conflict and fix template execution errors
- Integrate chezmoi data variables for scale, resolution, and peripherals
2025-12-27 22:52:43 +01:00

52 lines
1.9 KiB
Markdown

The `cffi` module gives full control of a GTK widget to a third-party dynamic library, to create more complex modules using different programming languages.
### Config
Addressed by `cffi/<name>`
| option | typeof | default | description |
|---------------|--------|---------|----------------------------------------------------------------|
| `module_path` | string | | The path to the dynamic library to load to control the widget. |
Some additional configuration may be required depending on the cffi dynamic library being used.
### Style
The classes and IDs are managed by the cffi dynamic library.
#### Examples:
##### C example:
`~/.config/waybar/config`
```jsonc
"cffi/c_example": {
"module_path": ".config/waybar/cffi/wb_cffi_example.so"
}
```
#### Developing new CFFI modules
CFFI modules require a handful of functions and constants to be defined with C linkage. The method to achieve this depends on the programming language being used (search for FFI / Foreign Function Interface).
An example written in C can be found in [resources/custom_modules/cffi_example/](https://github.com/Alexays/Waybar/tree/master/resources/custom_modules/cffi_example/)
The list of symbols to define can be found in [resources/custom_modules/cffi_example/waybar_cffi_module.h](https://github.com/Alexays/Waybar/tree/master/resources/custom_modules/cffi_example/waybar_cffi_module.h)
##### Known CFFI modules
- [waylyrics](https://github.com/PandeCode/waylyrics) - Module to display sync lyrics current line of in spotify.
- [libwaybar_cffi_lyrics](https://github.com/switchToLinux/libwaybar_cffi_lyrics) , 一个歌词显示插件,支持 musicfox 和支持mpris协议的播放器。
If you develop your own module, please add it here.
##### Known CFFI language bindings
- [Rust](https://crates.io/crates/waybar-cffi)