You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.en.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,22 @@ Piri is a high-performance [Niri](https://github.com/YaLTeR/niri) extension tool
13
13
- 🎯 **Window Rule**: Powerful rule engine. Automatically places windows based on regex matching and provides focus-triggered command execution with a built-in de-duplication mechanism (see [Window Rule Docs](docs/en/plugins/window_rule.md))
14
14
- 📐 **Workspace Rule**: Workspace window layout management. Provides automatic width adjustment, automatic tiling, automatic alignment, and automatic maximization. Integrates original Autofill functionality (see [Workspace Rule Docs](docs/en/plugins/workspace_rule.md))
15
15
- 🔒 **Singleton**: Single-instance assurance. Ensures specific applications remain globally unique, supporting quick focus or automatic process launching (see [Singleton Docs](docs/en/plugins/singleton.md))
16
+
- 📌 **Mark**: Named window marks for quick focus. Bind the focused window to a name and jump back later; bindings are in-memory only (see [Mark Docs](docs/en/plugins/mark.md))
16
17
- 📋 **Window Order**: Intelligent reordering. Automatically reorders tiled windows based on configured weights, preserving relative positions for identical weights to minimize movement (see [Window Order Docs](docs/en/plugins/window_order.md))
17
18
- 🍽️ **Swallow**: Window swallowing mechanism. Automatically hides parent windows when child windows are opened, allowing child windows to replace parent windows in the layout (see [Swallow Docs](docs/en/plugins/swallow.md))
18
19
20
+
## Window Matching
21
+
22
+
Piri uses a unified window matching mechanism: regex on `app_id` and/or `title`. Plugins such as `window_rule`, `singleton`, and `scratchpads` use it to find windows.
23
+
24
+
**Supported matching**:
25
+
- Full regular expression syntax
26
+
- Match `app_id` and/or `title`
27
+
- If both are set, **either** match can satisfy the rule (OR)
28
+
29
+
> **Note**: The Window Rule plugin also supports list matching for `app_id` and `title`; see [Window Rule Docs](docs/en/plugins/window_rule.md).
For detailed documentation, please refer to the [Singleton documentation](docs/en/plugins/singleton.md).
327
340
341
+
### Mark
342
+
343
+
Assign **named marks** (e.g. letters `a`, `b`) to windows for quick focus. Marks are kept in the daemon’s memory and are **cleared when the daemon restarts**. You only enable the plugin in `piri.toml` and bind `spawn` commands in Niri for marks you use often.
344
+
345
+
**Configuration example**:
346
+
347
+
```toml
348
+
[piri.plugins]
349
+
mark = true
350
+
```
351
+
352
+
**Quick usage**:
353
+
354
+
```bash
355
+
# No valid binding: bind focused window to name; binding exists and window lives: focus it
356
+
piri mark {name} toggle
357
+
358
+
# Force-bind focused window to name (overwrites previous binding)
359
+
piri mark {name} add
360
+
361
+
# Remove this mark
362
+
piri mark {name} delete
363
+
```
364
+
365
+
**Note**: Piri cannot capture the “next key” globally. To save shortcut slots, you can use a launcher (e.g. `fuzzel`) to pick a letter, then run the commands above. If Niri adds multi-key sequences or binding modes, you can group `piri mark …` calls under one prefix.
366
+
367
+
For detailed documentation, see the [Mark documentation](docs/en/plugins/mark.md).
368
+
328
369
### Window Order
329
370
330
371

The Mark plugin provides **named quick-focus targets**: bind a string (often a single letter, e.g. `a`) to the current window, then jump back to that window using the same name. Bindings live in the daemon’s memory only; **nothing is written to the config file**.
4
+
5
+
## Configuration
6
+
7
+
Enable the plugin:
8
+
9
+
```toml
10
+
[piri.plugins]
11
+
mark = true
12
+
```
13
+
14
+
No extra `[mark.*]` tables are required; all marks are created or removed at runtime via the CLI.
15
+
16
+
## Command Line
17
+
18
+
```bash
19
+
# If the mark points to a window that still exists → focus it; else bind the focused window to this mark
20
+
piri mark {name} toggle
21
+
22
+
# Remove this mark (success even if it did not exist)
23
+
piri mark {name} delete
24
+
25
+
# Bind the focused window to this mark (replaces any previous binding)
26
+
piri mark {name} add
27
+
```
28
+
29
+
Examples:
30
+
31
+
```bash
32
+
piri mark a toggle # First time: mark current window as a; later: jump to a
33
+
piri mark a add # Force re-bind current window to a
34
+
piri mark a delete # Clear a
35
+
```
36
+
37
+
## Behavior
38
+
39
+
1.**`toggle`**: If `name` is bound and the window still exists, **focus** that window; otherwise (unbound or window closed) **bind** the currently focused window to `name`.
40
+
2.**`add`**: Always sets `name` to the current focus, overwriting any previous binding without checking the old window.
41
+
3.**`delete`**: Removes the binding for `name`; idempotent.
42
+
43
+
To **change** which window a mark points to while the old binding is still valid, use **`add`**, or **`delete`** then **`toggle`**.
44
+
45
+
## Niri Keybindings
46
+
47
+
Piri cannot listen for the “next key” by itself. In Niri you typically add one `spawn` per mark you care about, for example:
48
+
49
+
```kdl
50
+
binds {
51
+
Mod+Shift+A { spawn "piri" "mark" "a" "toggle"; }
52
+
Mod+Shift+B { spawn "piri" "mark" "b" "toggle"; }
53
+
}
54
+
```
55
+
56
+
If Niri gains multi-key sequences or binding modes, you can group these under one prefix. See the main README for context.
57
+
58
+
## Limitations
59
+
60
+
-**Not persistent**: All marks are lost when `piri daemon` restarts.
61
+
-**No on-window labels**: Niri IPC does not provide drawing mark letters on window decorations; use a bar, notifications, or an external script if you need a visible list.
62
+
-**Requires focus**: `toggle` / `add` use the **currently focused** window; focus the target before invoking.
63
+
64
+
## Use Cases
65
+
66
+
- Short-lived bookmarks for a few windows you switch between often.
67
+
- Pairing with a launcher (e.g. `fuzzel` listing `a`–`z` then calling `piri mark …`) so you do not type the mark name manually every time.
Copy file name to clipboardExpand all lines: docs/en/plugins/plugins.md
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,14 @@ Executes commands when switching to specific empty workspaces. Useful for automa
22
22
- Workspace-based configuration
23
23
- Similar to Hyprland's `on-created-empty` workspace rule
24
24
25
+
### [Mark Plugin](mark.md)
26
+
27
+
Named marks for windows via `piri mark …`: bind the focused window or jump back to a marked window. Bindings are kept in daemon memory only; no per-mark tables in the config.
28
+
29
+
**Key features**:
30
+
-`toggle`, `add`, and `delete` operations
31
+
- Works well with Niri `spawn` keybindings or a launcher
32
+
25
33
### [Window Rule Plugin](window_rule.md)
26
34
27
35
Automatically moves windows to specified workspaces based on their `app_id` or `title`. Useful for automating window management and organizing applications.
@@ -50,10 +58,14 @@ You can control which plugins are enabled or disabled in the configuration file:
50
58
scratchpads = true
51
59
empty = true
52
60
window_rule = true
53
-
autofill = true
61
+
workspace_rule = true
62
+
singleton = true
63
+
window_order = true
64
+
swallow = true
65
+
mark = true
54
66
```
55
67
56
68
**Default Behavior**:
57
69
- If not explicitly specified, plugins are **disabled** by default (`false`)
58
-
-You must explicitly set `scratchpads = true`, `empty = true`, `window_rule = true`, or `autofill = true`to enable plugins
59
-
- Exception: `window_rule`plugin is enabled by default if window rules are configured (unless explicitly set to `false`)
70
+
-Set each plugin to `true` explicitly to enable it
71
+
- Exception: `window_rule` is enabled by default if window rules are configured (unless explicitly set to `false`)
0 commit comments