From e76985b1ef1c9c95cca205bf9ee3177157a8381a Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Wed, 31 Jul 2024 01:16:20 +0300 Subject: [PATCH] Plugins: reword/revamp --- pages/Plugins/Development/Advanced.md | 2 +- pages/Plugins/Development/Event-list.md | 2 +- pages/Plugins/Development/Getting-Started.md | 3 +-- pages/Plugins/Development/_index.md | 8 +++++++ pages/Plugins/Using-Plugins.md | 22 +++++++++++++------- pages/Plugins/_index.md | 5 +++++ 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/pages/Plugins/Development/Advanced.md b/pages/Plugins/Development/Advanced.md index 440e773..c5fd11c 100644 --- a/pages/Plugins/Development/Advanced.md +++ b/pages/Plugins/Development/Advanced.md @@ -132,7 +132,7 @@ Please remember that the pointer to your config value will never change after `PLUGIN_INIT`, so to greatly optimize performance, make it static: ```cpp -static auto* const MYVAR = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:myPlugin:variable1")->intValue; +static auto* const MYVAR = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:myPlugin:variable1")->intValue; ``` ## Further diff --git a/pages/Plugins/Development/Event-list.md b/pages/Plugins/Development/Event-list.md index 7ed5337..bb6b2b2 100644 --- a/pages/Plugins/Development/Event-list.md +++ b/pages/Plugins/Development/Event-list.md @@ -9,7 +9,7 @@ These are all the events that can be listened to using Event Hooks. {{< callout type=info >}} -M: means std::unordered_map following props are members. +`M:` means `std::unordered_map` following props are members. {{}} diff --git a/pages/Plugins/Development/Getting-Started.md b/pages/Plugins/Development/Getting-Started.md index 1b41cf3..7490261 100644 --- a/pages/Plugins/Development/Getting-Started.md +++ b/pages/Plugins/Development/Getting-Started.md @@ -71,8 +71,7 @@ APICALL EXPORT std::string PLUGIN_API_VERSION() { ``` This method will tell Hyprland what API version was used to compile this plugin. -Do NOT change it. It will be set automatically when compiling to the correct -value. +Do NOT change it. It will be set to the correct value when compiling. Skipping over some example handlers, we have two important functions: diff --git a/pages/Plugins/Development/_index.md b/pages/Plugins/Development/_index.md index 82abd5c..44d8efb 100644 --- a/pages/Plugins/Development/_index.md +++ b/pages/Plugins/Development/_index.md @@ -2,3 +2,11 @@ weight: 2 title: Development --- + +This section describes the process of developing plugins for Hyprland. It is +indented to be read by developers, not end users. + +- [Getting started](./Getting-Started) +- [Plugin guidelines](./Plugin-Guidelines) +- [Event list](./Event-list) +- [Advanced](./Advanced) diff --git a/pages/Plugins/Using-Plugins.md b/pages/Plugins/Using-Plugins.md index f34b78d..aa2632b 100644 --- a/pages/Plugins/Using-Plugins.md +++ b/pages/Plugins/Using-Plugins.md @@ -30,11 +30,11 @@ you will have to find yourself. ## Installing / Using plugins It is _highly_ recommended you use the Hyprland Plugin Manager, `hyprpm`. For -manual instructions, see a bit below. +manual instructions, see [here](#manual). ### hyprpm -Make sure you have the required dependencies: `cpio`, `meson`, `cmake`. +Make sure you have the required dependencies: `cpio`, `cmake`. Find a repository you want to install plugins from. As an example, we will use [hyprland-plugins](https://github.com/hyprwm/hyprland-plugins). @@ -69,11 +69,16 @@ If you don't have Hyprland headers installed, clone Hyprland, checkout to your version, build Hyprland, and run `sudo make installheaders`. Then build your plugin(s). -To load plugins manually, use `hyprctl plugin load path` !NOTE: Path HAS TO BE -ABSOLUTE! +To load plugins manually, use `hyprctl plugin load path`. You can unload plugins with `hyprctl plugin unload path`. +{{< callout >}} + +Path has to be absolute! + +{{< /callout >}} + ## FAQ About Plugins ### My Hyprland crashes! @@ -90,9 +95,12 @@ See [here](../Development/Getting-Started). ### Where do I find plugins? -You can find our featured plugins at [hyprland.org/plugins](https://hyprland.org/plugins/). -You can also see a list at [awesome-hyprland](https://github.com/hyprland-community/awesome-hyprland#plugins). Note that it may not be complete. -Lastly, you can try searching around github for the `"hyprland plugin"` keyword. +You can find our featured plugins at +[hyprland.org/plugins](https://hyprland.org/plugins/). You can also see a list +at +[awesome-hyprland](https://github.com/hyprland-community/awesome-hyprland#plugins). +Note that it may not be complete. Lastly, you can try searching around github +for the `"hyprland plugin"` keyword. ### Are plugins safe? diff --git a/pages/Plugins/_index.md b/pages/Plugins/_index.md index 0a1c75f..77feba0 100644 --- a/pages/Plugins/_index.md +++ b/pages/Plugins/_index.md @@ -2,3 +2,8 @@ weight: 6 title: Plugins --- + +Plugins allow users to add extra functionality to Hyprland. + +- [Using plugins](./Using-Plugins) +- [Plugin development](./Development)