From fa70fa6d0793f867811b73ab5303e73d5ff2e810 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 29 Mar 2024 02:46:58 +0000 Subject: [PATCH] improve plugin dev instructions --- pages/Plugins/Development/Getting-Started.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pages/Plugins/Development/Getting-Started.md b/pages/Plugins/Development/Getting-Started.md index 03c2787..f0f9284 100644 --- a/pages/Plugins/Development/Getting-Started.md +++ b/pages/Plugins/Development/Getting-Started.md @@ -80,6 +80,16 @@ Skipping over some example handlers, we have two important functions: APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE 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"}; @@ -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`) -Add this line: - -```ini -monitor = WL-1, 1920x1080, 0x0, 1 -``` - Launch the output `Hyprland` binary in `./build/` _when logged into a Hyprland session_.