move setprop to dispatchers (#832)

modified:   pages/Configuring/Dispatchers.md
modified:   pages/Configuring/Using-hyprctl.md
modified:   pages/Configuring/Window-Rules.md
This commit is contained in:
MightyPlaza 2024-10-28 18:19:11 +00:00 committed by GitHub
parent c4883659da
commit a1ca975f5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 77 deletions

View file

@ -81,6 +81,7 @@ layout pages (See the sidebar).
| global | Executes a Global Shortcut using the GlobalShortcuts portal. See [here](../Binds/#global-keybinds) | name | | global | Executes a Global Shortcut using the GlobalShortcuts portal. See [here](../Binds/#global-keybinds) | name |
| submap | Change the current mapping group. See [Submaps](../Binds/#submaps) | `reset` or name | | submap | Change the current mapping group. See [Submaps](../Binds/#submaps) | `reset` or name |
| event | Emits a custom event to socket2 in the form of `custom>>yourdata` | the data to send | | event | Emits a custom event to socket2 in the form of `custom>>yourdata` | the data to send |
| setprop | Sets a window property | `window property value` |
{{< callout type=warning >}} {{< callout type=warning >}}
@ -184,10 +185,7 @@ bind = SUPER, C, movetoworkspace, special
The `exec` dispatcher supports adding rules. Please note some windows might work The `exec` dispatcher supports adding rules. Please note some windows might work
better, some worse. It records the PID of the spawned process and uses that. better, some worse. It records the PID of the spawned process and uses that.
For example, if your process forks and then the fork opens a window, this will For example, if your process forks and then the fork opens a window, this will
not work. Rules will only be applied once. This means dynamic rules will be not work.
overridden as soon as a property of the window changes (e.g. switching focus).
To make dynamic rules stick around use `hyprctl setprop` (see
[Using hyprctl](../Using-hyprctl)).
The syntax is: The syntax is:
@ -200,3 +198,33 @@ For example:
```ini ```ini
bind = SUPER, E, exec, [workspace 2 silent; float; move 0 0] kitty bind = SUPER, E, exec, [workspace 2 silent; float; move 0 0] kitty
``` ```
### setprop
Prop List:
| prop | comment |
| --- | --- |
| alpha | float 0.0 - 1.0 |
| alphaoverride | 0/1, makes the next setting be override instead of multiply |
| alphainactive | float 0.0 - 1.0 |
| alphainactiveoverride | 0/1, makes the next setting be override instead of multiply |
| alphafullscreen | float 0.0 - 1.0 |
| alphafullscreenoverride | 0/1, makes the next setting be override instead of multiply |
| animationstyle | string, cannot be locked |
| activebordercolor | gradient, -1 means not set |
| inactivebordercolor | gradient, -1 means not set |
| maxsize | vec2 (`x y`) |
| minsize | vec2 (`x y`) |
Additional properties can be found in the [Window Rules](../Window-Rules#dynamic-rules) section.
For example:
```sh
address:0x13371337 noanim 1
address:0x13371337 nomaxsize 0
address:0x13371337 opaque toggle
address:0x13371337 immediate unset
```

View file

@ -194,76 +194,6 @@ To disable:
```sh ```sh
hyprctl seterror disable hyprctl seterror disable
``` ```
### setprop
Sets a window prop. Can be locked by adding `lock` at the end. If `lock` is not
added, will be unlocked. Locking means a dynamic windowrule _cannot_ override
this setting.
Usage:
```sh
hyprctl setprop <mode:regex> <property> <value> [lock]
```
Regex supports different modes. The supported modes are:
```ini
class - class
title - title
initialclass - initialClass
initialtitle - initialTitle
active - active window
address - address prefixed with 0x
pid - process ID
floating - first floating window on the current workspace
tiled - first tiled window on the current workspace
```
If no mode is specified `class` is used by default.
{{< callout type=info >}}
To get more information about a window, you can use `hyprctl clients`.
{{< /callout >}}
{{< callout type=warning >}}
Please beware that `hyprctl clients` will display the fields as **initialClass**
and **initialTitle** while the regex mode uses `initialclass` and
`initialtitle`.
{{< /callout >}}
Prop List:
| prop | comment |
| --- | --- |
| alpha | float 0.0 - 1.0 |
| alphaoverride | 0/1, makes the next setting be override instead of multiply |
| alphainactive | float 0.0 - 1.0 |
| alphainactiveoverride | 0/1, makes the next setting be override instead of multiply |
| alphafullscreen | float 0.0 - 1.0 |
| alphafullscreenoverride | 0/1, makes the next setting be override instead of multiply |
| animationstyle | string, cannot be locked |
| activebordercolor | gradient, -1 means not set |
| inactivebordercolor | gradient, -1 means not set |
| maxsize | vec2 (`x y`) |
| minsize | vec2 (`x y`) |
Additional properties can be found in the [Window Rules](../Window-Rules#dynamic-rules) section.
For example:
```sh
hyprctl setprop address:0x13371337 noanim 1
hyprctl setprop address:0x13371337 nomaxsize 0
hyprctl setprop address:0x13371337 opaque toggle
hyprctl setprop address:0x13371337 immediate unset
```
### notify ### notify
Sends a notification using the built-in Hyprland notification system. Sends a notification using the built-in Hyprland notification system.

View file

@ -133,7 +133,7 @@ Dynamic rules are re-evaluated every time a property changes.
| maxsize \[x\] \[y\] | sets the maximum size (x,y -> int) | | maxsize \[x\] \[y\] | sets the maximum size (x,y -> int) |
| minsize \[x\] \[y\] | sets the minimum size (x,y -> int) | | minsize \[x\] \[y\] | sets the minimum size (x,y -> int) |
The following rules can also be set with [`hyprctl setprop`](../Using-hyprctl#setprop): The following rules can also be set with [`setprop`](../Dispatchers#setprop):
| Rule | Description | | Rule | Description |
| ---- | ----------- | | ---- | ----------- |
@ -164,10 +164,10 @@ The following rules can also be set with [`hyprctl setprop`](../Using-hyprctl#se
When using window rules, \[on\] can be set to `0` for off, `1` for on or not set When using window rules, \[on\] can be set to `0` for off, `1` for on or not set
for default. for default.
When using `hyprctl setprop`, \[on\] can be set to `0` for off, `1` for on, When using `setprop`, \[on\] can be set to `0` for off, `1` for on,
`toggle` to toggle the state or `unset` to unset previous values. `toggle` to toggle the state or `unset` to unset previous values.
When using `hyprctl setprop`, \[int\] can also be `unset` to unset previous When using `setprop`, \[int\] can also be `unset` to unset previous
values. values.
### `group` window rule options ### `group` window rule options