hyprland-wiki/pages/Plugins/Using-Plugins.md

114 lines
3 KiB
Markdown
Raw Normal View History

---
weight: 1
title: Using plugins
---
2023-02-27 13:32:56 +01:00
This page will tell you how to use plugins.
2023-02-27 13:32:56 +01:00
2023-03-13 02:44:27 +01:00
## Disclaimers
{{< callout type=warning >}}
2023-03-13 02:44:27 +01:00
Plugins are written in C++ and will run as a part of Hyprland.
Make sure to _always_ read the source code of the plugins you are going to use
and to trust the source.
Writing a plugin to wipe your computer is easy.
_**Never**_ trust random `.so` files you receive from other people.
{{< /callout >}}
2023-03-13 02:44:27 +01:00
2023-02-27 13:32:56 +01:00
## Getting plugins
Plugins come as _shared objects_, aka. `.so` files.
Hyprland does not have any "default" plugins, so any plugin you may want to use
you will have to find yourself.
2023-02-27 13:32:56 +01:00
## Installing / Using plugins
It is _highly_ recommended you use the Hyprland Plugin Manager, `hyprpm`. For
2024-07-31 00:16:20 +02:00
manual instructions, see [here](#manual).
2023-02-27 13:32:56 +01:00
### hyprpm
2023-02-27 13:32:56 +01:00
2024-07-31 00:16:20 +02:00
Make sure you have the required dependencies: `cpio`, `cmake`.
2024-02-01 23:57:28 +01:00
Find a repository you want to install plugins from. As an example, we will use
[hyprland-plugins](https://github.com/hyprwm/hyprland-plugins).
2023-02-27 13:32:56 +01:00
```sh
hyprpm add https://github.com/hyprwm/hyprland-plugins
2023-02-27 13:32:56 +01:00
```
Once it finishes, you can list your installed plugins with:
2023-03-13 02:44:27 +01:00
```sh
hyprpm list
2023-03-13 02:44:27 +01:00
```
Then, enable or disable them via `hyprpm enable name` and `hyprpm disable name`.
2023-02-27 13:32:56 +01:00
In order for the plugins to be loaded into Hyprland, run `hyprpm reload`.
2023-06-10 00:05:39 +02:00
You can add `exec-once = hyprpm reload -n` to your Hyprland config to have
plugins loaded at startup. `-n` will make hyprpm send a notification for good and bad events (e.g. update needed, plugin loaded successfully) or use `-nn` to get notified only on failed events.
2023-06-10 00:05:39 +02:00
To update your plugins, run `hyprpm update`.
2023-06-10 00:05:39 +02:00
For all options of `hyprpm`, run `hyprpm -h`.
2023-03-13 02:44:27 +01:00
### Manual
Different plugins may have different build methods, refer to their instructions.
2023-03-13 02:44:27 +01:00
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).
2023-03-13 02:44:27 +01:00
2024-07-31 00:16:20 +02:00
To load plugins manually, use `hyprctl plugin load path`.
2023-02-27 13:32:56 +01:00
You can unload plugins with `hyprctl plugin unload path`.
2023-03-13 02:44:27 +01:00
2024-07-31 00:16:20 +02:00
{{< callout >}}
Path has to be absolute!
{{< /callout >}}
2023-02-27 13:32:56 +01:00
## FAQ About Plugins
2023-12-07 11:44:10 +01:00
### My Hyprland crashes!
2023-12-07 11:44:10 +01:00
Oh no. Oopsie. Usually means a plugin is broken. `hyprpm disable` it.
2023-02-27 13:32:56 +01:00
### How do I list my loaded plugins?
2023-02-27 13:32:56 +01:00
`hyprctl plugin list`
### How do I make my own plugin?
2024-03-17 13:44:39 +01:00
See [here](../Development/Getting-Started).
2023-02-27 13:32:56 +01:00
### Where do I find plugins?
2024-03-11 17:44:01 +01:00
2024-07-31 00:16:20 +02:00
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.
2023-02-27 13:32:56 +01:00
### Are plugins safe?
As long as you read the source code of your plugin(s) and can see there's
nothing bad going on, they will be safe.
2023-02-27 13:32:56 +01:00
### Do plugins decrease Hyprland's stability?
Hyprland employs a few tactics to unload plugins that crash. However, those
tactics may not always work. In general, as long as the plugin is well-designed,
it should not affect the stability of Hyprland.