-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathconfig.example.toml
More file actions
253 lines (217 loc) · 8.42 KB
/
Copy pathconfig.example.toml
File metadata and controls
253 lines (217 loc) · 8.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# Piri Configuration File
# Copy this file to ~/.config/niri/piri.toml
[niri]
# Optional: Path to niri socket
# If not specified, will use $XDG_RUNTIME_DIR/niri or /tmp/niri
# socket_path = "/tmp/niri"
# Plugin control: enable/disable plugins
# If not specified, plugins are disabled by default
[piri.plugins]
scratchpads = true
empty = true
window_rule = true
singleton = true
window_order = true
swallow = true
workspace_rule = true
mark = true
sticky = true
[piri.scratchpad]
default_size = "40% 60%"
default_margin = 50
# Optional: move hidden scratchpads to a specific workspace
# move_to_workspace = "tmp"
# Plugins configuration
# Empty plugin: executes commands when switching to empty workspaces
# Format: [empty.{workspace}]
# Workspace identifier can be:
# - name (String): workspace name, e.g., "main", "work"
# - idx (u8): workspace index, e.g., "1", "2", "3"
# - idx@output: workspace index on specific monitor, e.g., "1@DP-2", "1@HDMI-A-1"
# - name@output: workspace name on specific monitor, e.g., "browser@DP-2"
# Note: Matching order is idx@output first, then name@output, then name, then idx. ID (u64) is not used for matching.
[empty.1] # workspace index
command = "notify-send 'Workspace 1 is empty'"
[empty.browser] # workspace name
command = "google-chrome-stable"
# Scratchpads configuration
# Format: [scratchpads.{name}]
[scratchpads.term]
direction = "fromRight"
command = "GTK_IM_MODULE=wayland ghostty --class=float.dropterm"
app_id = "float.dropterm"
size = "40% 60%"
margin = 50
# Example: scratchpad with swallow_to_focus enabled
# When shown, the window will be swallowed into the currently focused window
[scratchpads.preview]
direction = "fromRight"
command = "imv"
app_id = "imv"
size = "60% 80%"
margin = 50
swallow_to_focus = true # Optional: swallow into focused window when shown
# Example: scratchpad with sticky behavior (delegates to sticky plugin)
[scratchpads.note]
direction = "fromTop"
command = "gnome-text-editor"
app_id = "org.gnome.TextEditor"
size = "50% 40%"
margin = 100
sticky = true # Optional: follow focused workspace (handled by sticky plugin)
# Example: scratchpad that auto-hides when focus is lost
# Note: sticky and auto_hide_on_focus_loss cannot both be enabled
[scratchpads.calc]
direction = "fromBottom"
command = "gnome-calculator"
app_id = "org.gnome.Calculator"
size = "30% 40%"
margin = 50
auto_hide_on_focus_loss = true # Optional: auto-hide when window loses focus
# Window rules: automatically move windows to workspaces based on app_id or title
# Format: [[window_rule]]
# - app_id: regex pattern to match window app_id (optional, but at least one of app_id or title must be specified)
# - title: regex pattern to match window title (optional, but at least one of app_id or title must be specified)
# - open_on_workspace: workspace to move matching windows to (exact name or idx match,
# supports monitor scoping with "idx@output" or "name@output" syntax, e.g., "1@DP-2")
# - focus_command: command to execute when window gains focus (optional)
# Note:
# - If both app_id and title are specified, the rule matches if EITHER matches (OR logic)
# - At least one of open_on_workspace or focus_command must be specified
# - Workspace matching: exact name match first, then exact idx match
# - Matching order: first matching rule is applied
# Example: match by app_id regex pattern, move to workspace by idx
[[window_rule]]
app_id = ".*firefox.*"
open_on_workspace = "2"
# Example: match by title regex pattern, move to workspace by idx, with focus_command
[[window_rule]]
title = ".*Chrome.*"
open_on_workspace = "3"
focus_command = "[[ $(fcitx5-remote) -eq 2 ]] && fcitx5-remote -c"
# Example: match by either app_id OR title, move to workspace by name
[[window_rule]]
app_id = "code"
title = ".*VS Code.*"
open_on_workspace = "browser"
# Example: only focus_command, don't move window
[[window_rule]]
title = ".*Chrome.*"
focus_command = "notify-send 'Chrome focused'"
# Example: exact app_id match (using regex anchors)
[[window_rule]]
app_id = "^code$"
open_on_workspace = "dev"
# Example: app_id as a list (any one matches)
[[window_rule]]
app_id = ["code", "code-oss", "codium"]
open_on_workspace = "dev"
# Example: title as a list (any one matches)
[[window_rule]]
title = ".*Chrome.*"
open_on_workspace = "browser"
[singleton.browser]
command = 'google-chrome-stable'
[singleton.term]
command = 'GTK_IM_MODULE=wayland ghostty --class=singleton.term'
app_id = 'singleton.term'
# Mark plugin:
# Runtime-only named marks for quick focus.
# No [mark.*] table is needed; use CLI:
# piri mark {name} toggle
# piri mark {name} add
# piri mark {name} delete
# Optional: [piri.mark] for refocus feature
# [piri.mark]
# refocus = true # Toggle same mark again to jump back to previous window
# Sticky plugin:
# Runtime-only sticky floating window state.
# No [sticky.*] table is needed; use CLI:
# piri sticky add
# piri sticky add --cross
# piri sticky delete
# Window order: reorder windows in workspace based on app_id
# Format: [piri.window_order] for plugin config, [window_order] for app_id weights
# - enable_event_listener: enable automatic reordering on events (default: false)
# - default_weight: default weight for windows not specified (default: 0)
# - workspaces: list of workspace names/indices to apply ordering (supports "idx@output" syntax, default: all workspaces)
# Use 'piri window_order toggle' to manually reorder windows in current workspace
[piri.window_order]
enable_event_listener = false
default_weight = 0
# workspaces = ["1", "2", "dev"] # Optional: only apply to specific workspaces (empty = all)
[window_order]
# Window-specific weights
google-chrome = 100
code = 80
ghostty = 70
[piri.swallow]
use_pid_matching=false
[piri.swallow.exclude]
app_id = ".*mpv*."
[[swallow]]
child_app_id='.*google-chrome.*'
parent_app_id='.*ghostty.*'
[[swallow]]
child_app_id='.*firefox*.'
parent_app_id='.*ghostty.*'
# Workspace rule: automatically adjust window widths based on window count
# Format: [workspace_rule.{workspace}]
# Workspace identifier can be name (e.g., "browser"), idx (e.g., "1"),
# or monitor-scoped: "idx@output" (e.g., "1@DP-2"), "name@output" (e.g., "browser@eDP-2")
# Matching order: idx@output > name@output > name > idx (backward compatible fallback)
# - auto_width: array where index corresponds to window count (1-based)
# Each element can be a string (all windows same width) or array (different widths per window)
# Examples:
# ["100%", "50%"] - 1 window: 100%, 2 windows: each 50%
# ["100%", ["45%", "55%"]] - 1 window: 100%, 2 windows: 45% and 55%
# ["100%", "50%", ["30%", "35%", "35%"]] - 1 window: 100%, 2 windows: 50% each, 3 windows: 30%, 35%, 35%
# Default configuration (applies to all workspaces without specific config)
[piri.workspace_rule]
auto_width = ["100%", "50%", "33.33%", "25%", "20%"]
# auto_maximize: automatically maximize window when there's only one window, and unmaximize when there are multiple windows
# auto_maximize = true
# EdgePulse: show left/right edge hint when focused column reaches the workspace edge
# [piri.workspace_rule.edge_pulse]
# enabled = true
# show_left = true
# show_right = true
# width = 14
# height_ratio = 0.42
# left_gradient_start = "#68d8ff"
# left_gradient_end = "#1f4fff"
# right_gradient_start = "#ffd36a"
# right_gradient_end = "#ff7a1f"
# alpha = 0.85
# Workspace-specific configuration (overrides default)
[workspace_rule.1]
auto_width = ["100%", "50%", "33.33%", "25%", "20%"]
# Example: workspace with custom widths, including nested arrays
[workspace_rule.browser]
# 1 window: 100%, 2 windows: 45% and 55%, 3 windows: 33.33% each
auto_width = ["100%", ["45%", "55%"], "33.33%"]
# Example: workspace with different widths for 3 windows
[workspace_rule.dev]
# 1 window: 100%, 2 windows: 50% each, 3 windows: 30%, 35%, 35%
auto_width = ["100%", "50%", ["30%", "35%", "35%"]]
# Example: workspace with auto_maximize enabled
[workspace_rule.main]
auto_maximize = true
# --- Monitor-scoped examples ---
#
# Exact match: applies to a specific monitor
# [workspace_rule."1@DP-2"]
# auto_width = ["100%", "50%", "33.33%"]
#
# Display prefix match: applies to all monitors of that type
# "1@DP" matches DP-1, DP-2, DP-3, ...
# "1@HDMI" matches HDMI-A-1, HDMI-A-2, ...
# [workspace_rule."1@DP"]
# auto_width = ["100%", "50%", "33.33%"]
# [workspace_rule."1@eDP"]
# auto_width = ["100%", "50%", "33.33%", "25%"]
#
# Per-monitor empty workspace commands
# [empty."1@HDMI-A-1"] ← exact match
# [empty."1@HDMI"] ← display prefix match
# command = "alacritty"