Plugins: reword/revamp

This commit is contained in:
Mihai Fufezan 2024-07-31 01:16:20 +03:00
parent 524ccb4d9d
commit a0278ab718
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
6 changed files with 31 additions and 11 deletions

View file

@ -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

View file

@ -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<std::string, std::any> following props are members.
`M:` means `std::unordered_map<std::string, std::any>` following props are members.
{{</ callout >}}

View file

@ -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:

View file

@ -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)

View file

@ -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?

View file

@ -2,3 +2,8 @@
weight: 6
title: Plugins
---
Plugins allow users to add extra functionality to Hyprland.
- [Using plugins](./Using-Plugins)
- [Plugin development](./Development)