2025-04-08 18:38:56 +01:00
---
2025-08-28 11:20:34 +02:00
weight: 14
2025-04-08 18:38:56 +01:00
title: Permissions
---
2025-12-09 13:56:34 +01:00
If you have `hyprland-guiutils` installed, you can make use of Hyprland's built-in
2025-04-08 18:38:56 +01:00
permission system.
2025-05-18 19:13:29 +02:00
For now, it only has a few permissions, but it might include more in the future.
2025-04-08 18:38:56 +01:00
## Permissions
Permissions work a bit like Android ones. If an app tries to do something sensitive with
the compositor (Hyprland), Hyprland will pop up a notification asking you if you
want to let it do that.
2025-10-29 20:52:11 +01:00
> [!NOTE]
> Before setting up permissions, make sure you enable them by setting
> `ecosystem:enforce_permissions = true`, as it's disabled by default.
2025-04-08 18:38:56 +01:00
### Configuring permissions
2025-10-29 20:52:11 +01:00
> [!IMPORTANT]
> Permissions set up in the config are **not** reloaded on-the-fly and require a Hyprland
> restart for security reasons.
2025-04-30 00:36:40 +01:00
2025-04-08 18:38:56 +01:00
Configuring them is simple:
```ini
permission = regex, permission, mode
```
for example:
```ini
permission = /usr/bin/grim, screencopy, allow
```
Will allow `/usr/bin/grim` to always capture your screen without asking.
2025-05-08 23:57:45 +01:00
```ini
permission = /usr/bin/appsuite-.*, screencopy, allow
```
Will allow any app whose path starts with `/usr/bin/appsuite-` to capture your screen without asking.
2025-04-08 18:38:56 +01:00
2025-07-25 21:37:39 +02:00
### Permission modes
2025-04-08 18:38:56 +01:00
There are 3 modes:
- `allow` : Don't ask, just allow the app to proceed.
- `ask` : Pop up a notification every time the app tries to do something sensitive. These popups allow you to Deny, Allow until the app exits, or Allow until Hyprland exits.
- `deny` : Don't ask, always deny the application access.
### Permission list
`screencopy` :
2025-05-18 19:13:29 +02:00
- Default: **ASK**
2025-04-08 18:38:56 +01:00
- Access to your screen _without_ going through xdg-desktop-portal-hyprland. Examples include: `grim` , `wl-screenrec` , `wf-recorder` .
- If denied, will render a black screen with a "permission denied" text.
- Why deny? For apps / scripts that might maliciously try to capture your screen without your knowledge by using wayland protocols directly.
2025-04-29 18:04:44 +01:00
`plugin` :
2025-05-18 19:13:29 +02:00
- Default: **ASK**
2025-04-29 18:04:44 +01:00
- Access to load a plugin. Can be either a regex for the app binary, or plugin path.
2025-05-08 23:57:45 +01:00
- Do _not_ allow `hyprctl` to load your plugins by default (attacker could issue `hyprctl plugin load /tmp/my-malicious-plugin.so` ) - use either `deny` to disable or `ask` to be prompted.
2025-04-08 18:38:56 +01:00
2025-05-18 19:13:29 +02:00
`keyboard` :
- Default: **ALLOW**
- Access to connecting a new keyboard. Regex of the device name.
- If you want to disable all keyboards not matching a regex, make a rule that sets `DENY` for `.*` _as the last keyboard permission rule_ .
- Why deny? Rubber duckies, malicious virtual / usb keyboards.
2025-04-08 18:38:56 +01:00
## Notes
**xdg-desktop-portal** implementations (including xdph) are just regular applications. They will go through permissions too. You might want to consider
adding a rule like this:
```ini
permission = /usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland, screencopy, allow
```
if you are not allowing screencopy for all apps.
< br / >
2025-06-22 15:02:07 +02:00
NixOS does not have static paths for the binaries, so regex has to be used. These example rules allow `grim` and `xdg-desktop-portal-hyprland` to copy the screen:
```ini
permission = /nix/store/[a-z0-9]{32}-grim-[0-9.]*/bin/grim, screencopy, allow
permission = /nix/store/[a-z0-9]{32}-xdg-desktop-portal-hyprland-[0-9.]*/libexec/.xdg-desktop-portal-hyprland-wrapped, screencopy, allow
```
2025-06-26 21:48:45 +02:00
When rendering the configuration with Nix itself, string interpolation can also be used (be aware that if the path contains special regex characters (e.g. `+` ) they need to be escaped):
2025-06-22 15:02:07 +02:00
```ini
2025-06-26 21:48:45 +02:00
permission = ${lib.getExe pkgs.grim}, screencopy, allow
permission = ${lib.escapeRegex (lib.getExe config.programs.hyprlock.package)}, screencopy, allow
2025-06-22 15:02:07 +02:00
permission = ${pkgs.xdg-desktop-portal-hyprland}/libexec/.xdg-desktop-portal-hyprland-wrapped, screencopy, allow
```
< br / >
2025-04-08 18:38:56 +01:00
On some **BSD** systems paths might not work. In such cases, you might want to disable permissions altogether, by setting
```ini
ecosystem {
enforce_permissions = false
}
```
otherwise, you have no _config_ control over permissions (popups will still work, although will not show paths, and "remember" will not be available).