mirror of
https://github.com/hyprwm/hyprland-wiki.git
synced 2024-11-22 20:55:59 +01:00
improve plugin dev instructions
This commit is contained in:
parent
1af8b1cced
commit
fa70fa6d07
1 changed files with 10 additions and 6 deletions
|
@ -80,6 +80,16 @@ Skipping over some example handlers, we have two important functions:
|
||||||
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
||||||
PHANDLE = handle;
|
PHANDLE = handle;
|
||||||
|
|
||||||
|
const std::string HASH = __hyprland_api_get_hash();
|
||||||
|
|
||||||
|
// ALWAYS add this to your plugins. It will prevent random crashes coming from
|
||||||
|
// mismatched header versions.
|
||||||
|
if (HASH != GIT_COMMIT_HASH) {
|
||||||
|
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.",
|
||||||
|
CColor{1.0, 0.2, 0.2, 1.0}, 5000);
|
||||||
|
throw std::runtime_error("[MyPlugin] Version mismatch");
|
||||||
|
}
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
return {"MyPlugin", "An amazing plugin that is going to change the world!", "Me", "1.0"};
|
return {"MyPlugin", "An amazing plugin that is going to change the world!", "Me", "1.0"};
|
||||||
|
@ -128,12 +138,6 @@ Remove _all_ `exec=` or `exec-once=` directives from your config.
|
||||||
|
|
||||||
_recommended_: Change the modifier for your keybinds (e.g. `SUPER` -> `ALT`)
|
_recommended_: Change the modifier for your keybinds (e.g. `SUPER` -> `ALT`)
|
||||||
|
|
||||||
Add this line:
|
|
||||||
|
|
||||||
```ini
|
|
||||||
monitor = WL-1, 1920x1080, 0x0, 1
|
|
||||||
```
|
|
||||||
|
|
||||||
Launch the output `Hyprland` binary in `./build/` _when logged into a Hyprland
|
Launch the output `Hyprland` binary in `./build/` _when logged into a Hyprland
|
||||||
session_.
|
session_.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue