1sway-ipc(7) Miscellaneous Information Manual sway-ipc(7)
2
3
4
6 sway-ipc - IPC protocol for sway
7
9 This details the interprocess communication (IPC) protocol for sway(1).
10 This IPC protocol can be used to control or obtain information from a
11 sway process.
12
13 The IPC protocol uses a UNIX socket as the method of communication. The
14 path to the socket is stored in the environment variable SWAYSOCK and,
15 for backwards compatibility with i3, I3SOCK. You can also retrieve the
16 socket path by calling sway --get-socketpath.
17
19 The format for messages and replies is:
20 <magic-string> <payload-length> <payload-type> <payload>
21 Where
22 <magic-string> is i3-ipc, for compatibility with i3
23 <payload-length> is a 32-bit integer in native byte order
24 <payload-type> is a 32-bit integer in native byte order
25
26 For example, sending the exit command would look like the following
27 hexdump:
28 00000000 | 69 33 2d 69 70 63 04 00 00 00 00 00 00 00 65 78 |i3-ipc........ex|
29 00000010 | 69 74 |it |
30
31 The payload for replies will be a valid serialized JSON data structure.
32
34 The following message types and their corresponding reply types are
35 currently supported. For all replies, any properties not listed are
36 subject to removal.
37
38 ┌────────────┬───────────────────┬─────────────────────┐
39 │TYPE NUMBER │ MESSAGE NAME │ PURPOSE │
40 ├────────────┼───────────────────┼─────────────────────┤
41 │ 0 │ RUN_COMMAND │ Runs the payload as │
42 │ │ │ sway commands │
43 ├────────────┼───────────────────┼─────────────────────┤
44 │ 1 │ GET_WORKSPACES │ Get the list of │
45 │ │ │ current workspaces │
46 ├────────────┼───────────────────┼─────────────────────┤
47 │ 2 │ SUBSCRIBE │ Subscribe the IPC │
48 │ │ │ connection to the │
49 │ │ │ events listed in │
50 │ │ │ the payload │
51 ├────────────┼───────────────────┼─────────────────────┤
52 │ 3 │ GET_OUTPUTS │ Get the list of │
53 │ │ │ current outputs │
54 ├────────────┼───────────────────┼─────────────────────┤
55 │ 4 │ GET_TREE │ Get the node layout │
56 │ │ │ tree │
57 ├────────────┼───────────────────┼─────────────────────┤
58 │ 5 │ GET_MARKS │ Get the names of │
59 │ │ │ all the marks cur‐ │
60 │ │ │ rently set │
61 ├────────────┼───────────────────┼─────────────────────┤
62 │ 6 │ GET_BAR_CONFIG │ Get the specified │
63 │ │ │ bar config or a │
64 │ │ │ list of bar config │
65 │ │ │ names │
66 ├────────────┼───────────────────┼─────────────────────┤
67 │ 7 │ GET_VERSION │ Get the version of │
68 │ │ │ sway that owns the │
69 │ │ │ IPC socket │
70 ├────────────┼───────────────────┼─────────────────────┤
71 │ 8 │ GET_BINDING_MODES │ Get the list of │
72 │ │ │ binding mode names │
73 ├────────────┼───────────────────┼─────────────────────┤
74 │ 9 │ GET_CONFIG │ Returns the config │
75 │ │ │ that was last │
76 │ │ │ loaded │
77 ├────────────┼───────────────────┼─────────────────────┤
78 │ 10 │ SEND_TICK │ Sends a tick event │
79 │ │ │ with the specified │
80 │ │ │ payload │
81 ├────────────┼───────────────────┼─────────────────────┤
82 │ 11 │ SYNC │ Replies failure ob‐ │
83 │ │ │ ject for i3 compat‐ │
84 │ │ │ ibility │
85 ├────────────┼───────────────────┼─────────────────────┤
86 │ 12 │ GET_BINDING_STATE │ Request the current │
87 │ │ │ binding state, e.g. │
88 │ │ │ the currently ac‐ │
89 │ │ │ tive binding mode │
90 │ │ │ name. │
91 ├────────────┼───────────────────┼─────────────────────┤
92 │ 100 │ GET_INPUTS │ Get the list of in‐ │
93 │ │ │ put devices │
94 ├────────────┼───────────────────┼─────────────────────┤
95 │ 101 │ GET_SEATS │ Get the list of │
96 │ │ │ seats │
97 └────────────┴───────────────────┴─────────────────────┘
98
99 0. RUN_COMMAND
100 MESSAGE
101 Parses and runs the payload as sway commands
102
103 REPLY
104 An array of objects corresponding to each command that was parsed. Each
105 object has the property success, which is a boolean indicating whether
106 the command was successful. The object may also contain the properties
107 error and parse_error. The error property is a human readable error
108 message while parse_error is a boolean indicating whether the reason
109 the command failed was because the command was unknown or not able to
110 be parsed.
111
112 Example Reply:
113 [
114 {
115 "success": true
116 },
117 {
118 "success": false,
119 "parse_error": true,
120 "error": "Invalid/unknown command"
121 }
122 ]
123
124 1. GET_WORKSPACES
125 MESSAGE
126 Retrieves the list of workspaces.
127
128 REPLY
129 The reply is an array of objects corresponding to each workspace. Each
130 object has the following properties:
131
132 ┌─────────┬───────────┬─────────────────────┐
133 │PROPERTY │ DATA TYPE │ DESCRIPTION │
134 ├─────────┼───────────┼─────────────────────┤
135 │ num │ integer │ The workspace num‐ │
136 │ │ │ ber or -1 for │
137 │ │ │ workspaces that do │
138 │ │ │ not start with a │
139 │ │ │ number │
140 ├─────────┼───────────┼─────────────────────┤
141 │ name │ string │ The name of the │
142 │ │ │ workspace │
143 ├─────────┼───────────┼─────────────────────┤
144 │visible │ boolean │ Whether the │
145 │ │ │ workspace is cur‐ │
146 │ │ │ rently visible on │
147 │ │ │ any output │
148 ├─────────┼───────────┼─────────────────────┤
149 │focused │ boolean │ Whether the │
150 │ │ │ workspace is cur‐ │
151 │ │ │ rently focused by │
152 │ │ │ the default seat │
153 │ │ │ (seat0) │
154 ├─────────┼───────────┼─────────────────────┤
155 │ urgent │ boolean │ Whether a view on │
156 │ │ │ the workspace has │
157 │ │ │ the urgent flag set │
158 ├─────────┼───────────┼─────────────────────┤
159 │ rect │ object │ The bounds of the │
160 │ │ │ workspace. It con‐ │
161 │ │ │ sists of x, y, │
162 │ │ │ width, and height │
163 ├─────────┼───────────┼─────────────────────┤
164 │ output │ string │ The name of the │
165 │ │ │ output that the │
166 │ │ │ workspace is on │
167 └─────────┴───────────┴─────────────────────┘
168
169 Example Reply:
170 [
171 {
172 "num": 1,
173 "name": "1",
174 "visible": true,
175 "focused": true,
176 "rect": {
177 "x": 0,
178 "y": 23,
179 "width": 1920,
180 "height": 1057
181 },
182 "output": "eDP-1"
183 },
184 ]
185
186 2. SUBSCRIBE
187 MESSAGE
188 Subscribe this IPC connection to the event types specified in the mes‐
189 sage payload. The payload should be a valid JSON array of events. See
190 the EVENTS section for the list of supported events.
191
192 REPLY
193 A single object that contains the property success, which is a boolean
194 value indicating whether the subscription was successful or not.
195
196 Example Reply:
197 {
198 "success": true
199 }
200
201 3. GET_OUTPUTS
202 MESSAGE
203 Retrieve the list of outputs
204
205 REPLY
206 An array of objects corresponding to each output. Each object has the
207 following properties:
208
209 ┌──────────────────┬───────────┬─────────────────────┐
210 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
211 ├──────────────────┼───────────┼─────────────────────┤
212 │ name │ string │ The name of the │
213 │ │ │ output. On DRM, │
214 │ │ │ this is the connec‐ │
215 │ │ │ tor │
216 ├──────────────────┼───────────┼─────────────────────┤
217 │ make │ string │ The make of the │
218 │ │ │ output │
219 ├──────────────────┼───────────┼─────────────────────┤
220 │ model │ string │ The model of the │
221 │ │ │ output │
222 ├──────────────────┼───────────┼─────────────────────┤
223 │ serial │ string │ The output's serial │
224 │ │ │ number as a hexa‐ │
225 │ │ │ decimal string │
226 ├──────────────────┼───────────┼─────────────────────┤
227 │ active │ boolean │ Whether this output │
228 │ │ │ is active/enabled │
229 ├──────────────────┼───────────┼─────────────────────┤
230 │ dpms │ boolean │ Whether this output │
231 │ │ │ is on/off (via │
232 │ │ │ DPMS) │
233 ├──────────────────┼───────────┼─────────────────────┤
234 │ primary │ boolean │ For i3 compatibil‐ │
235 │ │ │ ity, this will be │
236 │ │ │ false. It does not │
237 │ │ │ make sense in Way‐ │
238 │ │ │ land │
239 ├──────────────────┼───────────┼─────────────────────┤
240 │ scale │ float │ The scale currently │
241 │ │ │ in use on the out‐ │
242 │ │ │ put or -1 for dis‐ │
243 │ │ │ abled outputs │
244 ├──────────────────┼───────────┼─────────────────────┤
245 │subpixel_hinting │ string │ The subpixel hint‐ │
246 │ │ │ ing current in use │
247 │ │ │ on the output. This │
248 │ │ │ can be rgb, bgr, │
249 │ │ │ vrgb, vbgr, or none │
250 ├──────────────────┼───────────┼─────────────────────┤
251 │ transform │ string │ The transform cur‐ │
252 │ │ │ rently in use for │
253 │ │ │ the output. This │
254 │ │ │ can be normal, 90, │
255 │ │ │ 180, 270, │
256 │ │ │ flipped-90, │
257 │ │ │ flipped-180, or │
258 │ │ │ flipped-270 │
259 ├──────────────────┼───────────┼─────────────────────┤
260 │current_workspace │ string │ The workspace cur‐ │
261 │ │ │ rently visible on │
262 │ │ │ the output or null │
263 │ │ │ for disabled out‐ │
264 │ │ │ puts │
265 ├──────────────────┼───────────┼─────────────────────┤
266 │ modes │ array │ An array of sup‐ │
267 │ │ │ ported mode ob‐ │
268 │ │ │ jects. Each object │
269 │ │ │ contains width, │
270 │ │ │ height, and refresh │
271 ├──────────────────┼───────────┼─────────────────────┤
272 │ current_mode │ object │ An object repre‐ │
273 │ │ │ senting the current │
274 │ │ │ mode containing │
275 │ │ │ width, height, and │
276 │ │ │ refresh │
277 ├──────────────────┼───────────┼─────────────────────┤
278 │ rect │ object │ The bounds for the │
279 │ │ │ output consisting │
280 │ │ │ of x, y, width, and │
281 │ │ │ height │
282 └──────────────────┴───────────┴─────────────────────┘
283
284 Example Reply:
285 [
286 {
287 "name": "HDMI-A-2",
288 "make": "Unknown",
289 "model": "NS-19E310A13",
290 "serial": "0x00000001",
291 "active": true,
292 "primary": false,
293 "scale": 1.0,
294 "subpixel_hinting": "rgb",
295 "transform": "normal",
296 "current_workspace": "1",
297 "modes": [
298 {
299 "width": 640,
300 "height": 480,
301 "refresh": 59940
302 },
303 {
304 "width": 800,
305 "height": 600,
306 "refresh": 60317
307 },
308 {
309 "width": 1024,
310 "height": 768,
311 "refresh": 60004
312 },
313 {
314 "width": 1920,
315 "height": 1080,
316 "refresh": 60000
317 }
318 ],
319 "current_mode": {
320 "width": 1920,
321 "height": 1080,
322 "refresh": 60000
323 }
324 }
325 ]
326
327 4. GET_TREE
328 MESSAGE
329 Retrieve a JSON representation of the tree
330
331 REPLY
332 An array of objects that represent the current tree. Each object repre‐
333 sents one node and will have the following properties:
334
335 ┌──────────────────┬───────────┬─────────────────────┐
336 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
337 ├──────────────────┼───────────┼─────────────────────┤
338 │ id │ integer │ The internal unique │
339 │ │ │ ID for this node │
340 ├──────────────────┼───────────┼─────────────────────┤
341 │ name │ string │ The name of the │
342 │ │ │ node such as the │
343 │ │ │ output name or win‐ │
344 │ │ │ dow title. For the │
345 │ │ │ scratchpad, this │
346 │ │ │ will be │
347 │ │ │ __i3_scratch for │
348 │ │ │ compatibility with │
349 │ │ │ i3. │
350 ├──────────────────┼───────────┼─────────────────────┤
351 │ type │ string │ The node type. It │
352 │ │ │ can be root, out‐ │
353 │ │ │ put, workspace, │
354 │ │ │ con, or float‐ │
355 │ │ │ ing_con │
356 ├──────────────────┼───────────┼─────────────────────┤
357 │ border │ string │ The border style │
358 │ │ │ for the node. It │
359 │ │ │ can be normal, │
360 │ │ │ none, pixel, or csd │
361 ├──────────────────┼───────────┼─────────────────────┤
362 │ current_bor‐ │ integer │ Number of pixels │
363 │ der_width │ │ used for the border │
364 │ │ │ width │
365 ├──────────────────┼───────────┼─────────────────────┤
366 │ layout │ string │ The node's layout. │
367 │ │ │ It can either be │
368 │ │ │ splith, splitv, │
369 │ │ │ stacked, tabbed, or │
370 │ │ │ output │
371 ├──────────────────┼───────────┼─────────────────────┤
372 │ orientation │ string │ The node's orienta‐ │
373 │ │ │ tion. It can be │
374 │ │ │ vertical, horizon‐ │
375 │ │ │ tal, or none │
376 ├──────────────────┼───────────┼─────────────────────┤
377 │ percent │ float │ The percentage of │
378 │ │ │ the node's parent │
379 │ │ │ that it takes up or │
380 │ │ │ null for the root │
381 │ │ │ and other special │
382 │ │ │ nodes such as the │
383 │ │ │ scratchpad │
384 ├──────────────────┼───────────┼─────────────────────┤
385 │ rect │ object │ The absolute geome‐ │
386 │ │ │ try of the node. │
387 │ │ │ The window decora‐ │
388 │ │ │ tions are excluded │
389 │ │ │ from this, but bor‐ │
390 │ │ │ ders are included. │
391 ├──────────────────┼───────────┼─────────────────────┤
392 │ window_rect │ object │ The geometry of the │
393 │ │ │ contents inside the │
394 │ │ │ node. The window │
395 │ │ │ decorations are ex‐ │
396 │ │ │ cluded from this │
397 │ │ │ calculation, but │
398 │ │ │ borders are in‐ │
399 │ │ │ cluded. │
400 ├──────────────────┼───────────┼─────────────────────┤
401 │ deco_rect │ object │ The geometry of the │
402 │ │ │ decorations for the │
403 │ │ │ node relative to │
404 │ │ │ the parent node │
405 ├──────────────────┼───────────┼─────────────────────┤
406 │ geometry │ object │ The natural geome‐ │
407 │ │ │ try of the contents │
408 │ │ │ if it were to size │
409 │ │ │ itself │
410 ├──────────────────┼───────────┼─────────────────────┤
411 │ urgent │ boolean │ Whether the node or │
412 │ │ │ any of its descen‐ │
413 │ │ │ dants has the ur‐ │
414 │ │ │ gent hint set. │
415 │ │ │ Note: This may not │
416 │ │ │ exist when compiled │
417 │ │ │ without xwayland │
418 │ │ │ support │
419 ├──────────────────┼───────────┼─────────────────────┤
420 │ sticky │ boolean │ Whether the node is │
421 │ │ │ sticky (shows on │
422 │ │ │ all workspaces) │
423 ├──────────────────┼───────────┼─────────────────────┤
424 │ marks │ array │ List of marks as‐ │
425 │ │ │ signed to the node │
426 ├──────────────────┼───────────┼─────────────────────┤
427 │ focused │ boolean │ Whether the node is │
428 │ │ │ currently focused │
429 │ │ │ by the default seat │
430 │ │ │ (seat0) │
431 ├──────────────────┼───────────┼─────────────────────┤
432 │ focus │ array │ Array of child node │
433 │ │ │ IDs in the current │
434 │ │ │ focus order │
435 ├──────────────────┼───────────┼─────────────────────┤
436 │ nodes │ array │ The tiling children │
437 │ │ │ nodes for the node │
438 ├──────────────────┼───────────┼─────────────────────┤
439 │ floating_nodes │ array │ The floating chil‐ │
440 │ │ │ dren nodes for the │
441 │ │ │ node │
442 ├──────────────────┼───────────┼─────────────────────┤
443 │ representation │ string │ (Only workspaces) A │
444 │ │ │ string representa‐ │
445 │ │ │ tion of the layout │
446 │ │ │ of the workspace │
447 │ │ │ that can be used as │
448 │ │ │ an aid in submit‐ │
449 │ │ │ ting reproduction │
450 │ │ │ steps for bug re‐ │
451 │ │ │ ports │
452 ├──────────────────┼───────────┼─────────────────────┤
453 │ fullscreen_mode │ integer │ (Only containers │
454 │ │ │ and views) The │
455 │ │ │ fullscreen mode of │
456 │ │ │ the node. 0 means │
457 │ │ │ none, 1 means full │
458 │ │ │ workspace, and 2 │
459 │ │ │ means global │
460 │ │ │ fullscreen │
461 ├──────────────────┼───────────┼─────────────────────┤
462 │ app_id │ string │ (Only views) For an │
463 │ │ │ xdg-shell view, the │
464 │ │ │ name of the appli‐ │
465 │ │ │ cation, if set. │
466 │ │ │ Otherwise, null │
467 ├──────────────────┼───────────┼─────────────────────┤
468 │ pid │ integer │ (Only views) The │
469 │ │ │ PID of the applica‐ │
470 │ │ │ tion that owns the │
471 │ │ │ view │
472 ├──────────────────┼───────────┼─────────────────────┤
473 │ visible │ boolean │ (Only views) │
474 │ │ │ Whether the node is │
475 │ │ │ visible │
476 ├──────────────────┼───────────┼─────────────────────┤
477 │ shell │ string │ (Only views) The │
478 │ │ │ shell of the view, │
479 │ │ │ such as xdg_shell │
480 │ │ │ or xwayland │
481 ├──────────────────┼───────────┼─────────────────────┤
482 │ inhibit_idle │ boolean │ (Only views) │
483 │ │ │ Whether the view is │
484 │ │ │ inhibiting the idle │
485 │ │ │ state │
486 ├──────────────────┼───────────┼─────────────────────┤
487 │ idle_inhibitors │ object │ (Only views) An ob‐ │
488 │ │ │ ject containing the │
489 │ │ │ state of the appli‐ │
490 │ │ │ cation and user │
491 │ │ │ idle inhibitors. │
492 │ │ │ application can be │
493 │ │ │ enabled or none. │
494 │ │ │ user can be focus, │
495 │ │ │ fullscreen, open, │
496 │ │ │ visible or none. │
497 ├──────────────────┼───────────┼─────────────────────┤
498 │ window │ integer │ (Only xwayland │
499 │ │ │ views) The X11 win‐ │
500 │ │ │ dow ID for the │
501 │ │ │ xwayland view │
502 ├──────────────────┼───────────┼─────────────────────┤
503 │window_properties │ object │ (Only xwayland │
504 │ │ │ views) An object │
505 │ │ │ containing the ti‐ │
506 │ │ │ tle, class, in‐ │
507 │ │ │ stance, win‐ │
508 │ │ │ dow_role, win‐ │
509 │ │ │ dow_type, and tran‐ │
510 │ │ │ sient_for for the │
511 │ │ │ view │
512 └──────────────────┴───────────┴─────────────────────┘
513
514 Example Reply:
515 {
516 "id": 1,
517 "name": "root",
518 "rect": {
519 "x": 0,
520 "y": 0,
521 "width": 1920,
522 "height": 1080
523 },
524 "focused": false,
525 "focus": [
526 3
527 ],
528 "border": "none",
529 "current_border_width": 0,
530 "layout": "splith",
531 "orientation": "horizontal",
532 "percent": null,
533 "window_rect": {
534 "x": 0,
535 "y": 0,
536 "width": 0,
537 "height": 0
538 },
539 "deco_rect": {
540 "x": 0,
541 "y": 0,
542 "width": 0,
543 "height": 0
544 },
545 "geometry": {
546 "x": 0,
547 "y": 0,
548 "width": 0,
549 "height": 0
550 },
551 "window": null,
552 "urgent": false,
553 "floating_nodes": [
554 ],
555 "sticky": false,
556 "type": "root",
557 "nodes": [
558 {
559 "id": 2147483647,
560 "name": "__i3",
561 "rect": {
562 "x": 0,
563 "y": 0,
564 "width": 1920,
565 "height": 1080
566 },
567 "focused": false,
568 "focus": [
569 2147483646
570 ],
571 "border": "none",
572 "current_border_width": 0,
573 "layout": "output",
574 "orientation": "horizontal",
575 "percent": null,
576 "window_rect": {
577 "x": 0,
578 "y": 0,
579 "width": 0,
580 "height": 0
581 },
582 "deco_rect": {
583 "x": 0,
584 "y": 0,
585 "width": 0,
586 "height": 0
587 },
588 "geometry": {
589 "x": 0,
590 "y": 0,
591 "width": 0,
592 "height": 0
593 },
594 "window": null,
595 "urgent": false,
596 "floating_nodes": [
597 ],
598 "sticky": false,
599 "type": "output",
600 "nodes": [
601 {
602 "id": 2147483646,
603 "name": "__i3_scratch",
604 "rect": {
605 "x": 0,
606 "y": 0,
607 "width": 1920,
608 "height": 1080
609 },
610 "focused": false,
611 "focus": [
612 ],
613 "border": "none",
614 "current_border_width": 0,
615 "layout": "splith",
616 "orientation": "horizontal",
617 "percent": null,
618 "window_rect": {
619 "x": 0,
620 "y": 0,
621 "width": 0,
622 "height": 0
623 },
624 "deco_rect": {
625 "x": 0,
626 "y": 0,
627 "width": 0,
628 "height": 0
629 },
630 "geometry": {
631 "x": 0,
632 "y": 0,
633 "width": 0,
634 "height": 0
635 },
636 "window": null,
637 "urgent": false,
638 "floating_nodes": [
639 ],
640 "sticky": false,
641 "type": "workspace"
642 }
643 ]
644 },
645 {
646 "id": 3,
647 "name": "eDP-1",
648 "rect": {
649 "x": 0,
650 "y": 0,
651 "width": 1920,
652 "height": 1080
653 },
654 "focused": false,
655 "focus": [
656 4
657 ],
658 "border": "none",
659 "current_border_width": 0,
660 "layout": "output",
661 "orientation": "none",
662 "percent": 1.0,
663 "window_rect": {
664 "x": 0,
665 "y": 0,
666 "width": 0,
667 "height": 0
668 },
669 "deco_rect": {
670 "x": 0,
671 "y": 0,
672 "width": 0,
673 "height": 0
674 },
675 "geometry": {
676 "x": 0,
677 "y": 0,
678 "width": 0,
679 "height": 0
680 },
681 "window": null,
682 "urgent": false,
683 "floating_nodes": [
684 ],
685 "sticky": false,
686 "type": "output",
687 "active": true,
688 "primary": false,
689 "make": "Unknown",
690 "model": "0x38ED",
691 "serial": "0x00000000",
692 "scale": 1.0,
693 "transform": "normal",
694 "current_workspace": "1",
695 "modes": [
696 {
697 "width": 1920,
698 "height": 1080,
699 "refresh": 60052
700 }
701 ],
702 "current_mode": {
703 "width": 1920,
704 "height": 1080,
705 "refresh": 60052
706 },
707 "nodes": [
708 {
709 "id": 4,
710 "name": "1",
711 "rect": {
712 "x": 0,
713 "y": 23,
714 "width": 1920,
715 "height": 1057
716 },
717 "focused": false,
718 "focus": [
719 6,
720 5
721 ],
722 "border": "none",
723 "current_border_width": 0,
724 "layout": "splith",
725 "orientation": "horizontal",
726 "percent": null,
727 "window_rect": {
728 "x": 0,
729 "y": 0,
730 "width": 0,
731 "height": 0
732 },
733 "deco_rect": {
734 "x": 0,
735 "y": 0,
736 "width": 0,
737 "height": 0
738 },
739 "geometry": {
740 "x": 0,
741 "y": 0,
742 "width": 0,
743 "height": 0
744 },
745 "window": null,
746 "urgent": false,
747 "floating_nodes": [
748 ],
749 "sticky": false,
750 "num": 1,
751 "output": "eDP-1",
752 "type": "workspace",
753 "representation": "H[URxvt termite]",
754 "nodes": [
755 {
756 "id": 5,
757 "name": "urxvt",
758 "rect": {
759 "x": 0,
760 "y": 23,
761 "width": 960,
762 "height": 1057
763 },
764 "focused": false,
765 "focus": [
766 ],
767 "border": "normal",
768 "current_border_width": 2,
769 "layout": "none",
770 "orientation": "none",
771 "percent": 0.5,
772 "window_rect": {
773 "x": 2,
774 "y": 0,
775 "width": 956,
776 "height": 1030
777 },
778 "deco_rect": {
779 "x": 0,
780 "y": 0,
781 "width": 960,
782 "height": 25
783 },
784 "geometry": {
785 "x": 0,
786 "y": 0,
787 "width": 1124,
788 "height": 422
789 },
790 "window": 4194313,
791 "urgent": false,
792 "floating_nodes": [
793 ],
794 "sticky": false,
795 "type": "con",
796 "fullscreen_mode": 0,
797 "pid": 23959,
798 "app_id": null,
799 "visible": true,
800 "shell": "xwayland",
801 "inhibit_idle": true,
802 "idle_inhibitors": {
803 "application": "none",
804 "user": "visible",
805 },
806 "window_properties": {
807 "class": "URxvt",
808 "instance": "urxvt",
809 "title": "urxvt",
810 "transient_for": null
811 },
812 "nodes": [
813 ]
814 },
815 {
816 "id": 6,
817 "name": "",
818 "rect": {
819 "x": 960,
820 "y": 23,
821 "width": 960,
822 "height": 1057
823 },
824 "focused": true,
825 "focus": [
826 ],
827 "border": "normal",
828 "current_border_width": 2,
829 "layout": "none",
830 "orientation": "none",
831 "percent": 0.5,
832 "window_rect": {
833 "x": 2,
834 "y": 0,
835 "width": 956,
836 "height": 1030
837 },
838 "deco_rect": {
839 "x": 0,
840 "y": 0,
841 "width": 960,
842 "height": 25
843 },
844 "geometry": {
845 "x": 0,
846 "y": 0,
847 "width": 817,
848 "height": 458
849 },
850 "window": null,
851 "urgent": false,
852 "floating_nodes": [
853 ],
854 "sticky": false,
855 "type": "con",
856 "fullscreen_mode": 0,
857 "pid": 25370,
858 "app_id": "termite",
859 "visible": true,
860 "shell": "xdg_shell",
861 "inhibit_idle": false,
862 "idle_inhibitors": {
863 "application": "none",
864 "user": "fullscreen",
865 },
866 "nodes": [
867 ]
868 }
869 ]
870 }
871 ]
872 }
873 ]
874 }
875
876 5. GET_MARKS
877 MESSAGE
878 Retrieve the currently set marks
879
880 REPLY
881 An array of marks current set. Since each mark can only be set for one
882 container, this is a set so each value is unique and the order is unde‐
883 fined.
884
885 Example Reply:
886 [
887 "one",
888 "test"
889 ]
890
891 6. GET_BAR_CONFIG (WITHOUT A PAYLOAD)
892 MESSAGE
893 When sending without a payload, this retrieves the list of configured
894 bar IDs
895
896 REPLY
897 An array of bar IDs, which are strings
898
899 Example Reply:
900 [
901 "bar-0",
902 "bar-1"
903 ]
904
905 6. GET_BAR_CONFIG (WITH A PAYLOAD)
906 MESSAGE
907 When sent with a bar ID as the payload, this retrieves the config asso‐
908 ciated with the specified by the bar ID in the payload. This is used by
909 swaybar, but could also be used for third party bars
910
911 REPLY
912 An object that represents the configuration for the bar with the bar ID
913 sent as the payload. The following properties exists and more informa‐
914 tion about what their value mean can be found in sway-bar(5):
915
916 ┌────────────────────┬───────────┬─────────────────────┐
917 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
918 ├────────────────────┼───────────┼─────────────────────┤
919 │ id │ string │ The bar ID │
920 ├────────────────────┼───────────┼─────────────────────┤
921 │ mode │ string │ The mode for the │
922 │ │ │ bar. It can be │
923 │ │ │ dock, hide, or in‐ │
924 │ │ │ visible │
925 ├────────────────────┼───────────┼─────────────────────┤
926 │ position │ string │ The bar's position. │
927 │ │ │ It can currently │
928 │ │ │ either be bottom or │
929 │ │ │ top │
930 ├────────────────────┼───────────┼─────────────────────┤
931 │ status_command │ string │ The command which │
932 │ │ │ should be run to │
933 │ │ │ generate the status │
934 │ │ │ line │
935 ├────────────────────┼───────────┼─────────────────────┤
936 │ font │ string │ The font to use for │
937 │ │ │ the text on the bar │
938 ├────────────────────┼───────────┼─────────────────────┤
939 │ workspace_buttons │ boolean │ Whether to display │
940 │ │ │ the workspace but‐ │
941 │ │ │ tons on the bar │
942 ├────────────────────┼───────────┼─────────────────────┤
943 │workspace_min_width │ integer │ Minimum width in px │
944 │ │ │ for the workspace │
945 │ │ │ buttons on the bar │
946 ├────────────────────┼───────────┼─────────────────────┤
947 │binding_mode_indi‐ │ boolean │ Whether to display │
948 │cator │ │ the current binding │
949 │ │ │ mode on the bar │
950 ├────────────────────┼───────────┼─────────────────────┤
951 │ verbose │ boolean │ For i3 compatibil‐ │
952 │ │ │ ity, this will be │
953 │ │ │ the boolean value │
954 │ │ │ false. │
955 ├────────────────────┼───────────┼─────────────────────┤
956 │ colors │ object │ An object contain‐ │
957 │ │ │ ing the #RRGGBBAA │
958 │ │ │ colors to use for │
959 │ │ │ the bar. See below │
960 │ │ │ for more informa‐ │
961 │ │ │ tion │
962 ├────────────────────┼───────────┼─────────────────────┤
963 │ gaps │ object │ An object repre‐ │
964 │ │ │ senting the gaps │
965 │ │ │ for the bar con‐ │
966 │ │ │ sisting of top, │
967 │ │ │ right, bottom, and │
968 │ │ │ left. │
969 ├────────────────────┼───────────┼─────────────────────┤
970 │ bar_height │ integer │ The absolute height │
971 │ │ │ to use for the bar │
972 │ │ │ or 0 to automati‐ │
973 │ │ │ cally size based on │
974 │ │ │ the font │
975 ├────────────────────┼───────────┼─────────────────────┤
976 │ status_padding │ integer │ The vertical pad‐ │
977 │ │ │ ding to use for the │
978 │ │ │ status line │
979 ├────────────────────┼───────────┼─────────────────────┤
980 │status_edge_padding │ integer │ The horizontal pad‐ │
981 │ │ │ ding to use for the │
982 │ │ │ status line when at │
983 │ │ │ the end of an out‐ │
984 │ │ │ put │
985 └────────────────────┴───────────┴─────────────────────┘
986
987 The colors object contains the following properties, which are all
988 strings containing the #RRGGBBAA representation of the color:
989
990 ┌──────────────────────────┬────────────────────────────┐
991 │ PROPERTY │ DESCRIPTION │
992 ├──────────────────────────┼────────────────────────────┤
993 │ background │ The color to use for the │
994 │ │ bar background on unfo‐ │
995 │ │ cused outputs │
996 ├──────────────────────────┼────────────────────────────┤
997 │ statusline │ The color to use for the │
998 │ │ status line text on unfo‐ │
999 │ │ cused outputs │
1000 ├──────────────────────────┼────────────────────────────┤
1001 │ separator │ The color to use for the │
1002 │ │ separator text on unfo‐ │
1003 │ │ cused outputs │
1004 ├──────────────────────────┼────────────────────────────┤
1005 │ focused_background │ The color to use for the │
1006 │ │ background of the bar on │
1007 │ │ the focused output │
1008 ├──────────────────────────┼────────────────────────────┤
1009 │ focused_statusline │ The color to use for the │
1010 │ │ status line text on the │
1011 │ │ focused output │
1012 ├──────────────────────────┼────────────────────────────┤
1013 │ focused_separator │ The color to use for the │
1014 │ │ separator text on the fo‐ │
1015 │ │ cused output │
1016 ├──────────────────────────┼────────────────────────────┤
1017 │ focused_workspace_text │ The color to use for the │
1018 │ │ text of the focused │
1019 │ │ workspace button │
1020 ├──────────────────────────┼────────────────────────────┤
1021 │ focused_workspace_bg │ The color to use for the │
1022 │ │ background of the focused │
1023 │ │ workspace button │
1024 ├──────────────────────────┼────────────────────────────┤
1025 │focused_workspace_border │ The color to use for the │
1026 │ │ border of the focused │
1027 │ │ workspace button │
1028 ├──────────────────────────┼────────────────────────────┤
1029 │ active_workspace_text │ The color to use for the │
1030 │ │ text of the workspace but‐ │
1031 │ │ tons for the visible │
1032 │ │ workspaces on unfocused │
1033 │ │ outputs │
1034 ├──────────────────────────┼────────────────────────────┤
1035 │ active_workspace_bg │ The color to use for the │
1036 │ │ background of the │
1037 │ │ workspace buttons for the │
1038 │ │ visible workspaces on un‐ │
1039 │ │ focused outputs │
1040 ├──────────────────────────┼────────────────────────────┤
1041 │ active_workspace_border │ The color to use for the │
1042 │ │ border of the workspace │
1043 │ │ buttons for the visible │
1044 │ │ workspaces on unfocused │
1045 │ │ outputs │
1046 ├──────────────────────────┼────────────────────────────┤
1047 │ inactive_workspace_text │ The color to use for the │
1048 │ │ text of the workspace but‐ │
1049 │ │ tons for workspaces that │
1050 │ │ are not visible │
1051 ├──────────────────────────┼────────────────────────────┤
1052 │ inactive_workspace_bg │ The color to use for the │
1053 │ │ background of the │
1054 │ │ workspace buttons for │
1055 │ │ workspaces that are not │
1056 │ │ visible │
1057 ├──────────────────────────┼────────────────────────────┤
1058 │inactive_workspace_border │ The color to use for the │
1059 │ │ border of the workspace │
1060 │ │ buttons for workspaces │
1061 │ │ that are not visible │
1062 ├──────────────────────────┼────────────────────────────┤
1063 │ urgent_workspace_text │ The color to use for the │
1064 │ │ text of the workspace but‐ │
1065 │ │ tons for workspaces that │
1066 │ │ contain an urgent view │
1067 ├──────────────────────────┼────────────────────────────┤
1068 │ urgent_workspace_bg │ The color to use for the │
1069 │ │ background of the │
1070 │ │ workspace buttons for │
1071 │ │ workspaces that contain an │
1072 │ │ urgent view │
1073 ├──────────────────────────┼────────────────────────────┤
1074 │ urgent_workspace_border │ The color to use for the │
1075 │ │ border of the workspace │
1076 │ │ buttons for workspaces │
1077 │ │ that contain an urgent │
1078 │ │ view │
1079 ├──────────────────────────┼────────────────────────────┤
1080 │ binding_mode_text │ The color to use for the │
1081 │ │ text of the binding mode │
1082 │ │ indicator │
1083 ├──────────────────────────┼────────────────────────────┤
1084 │ binding_mode_bg │ The color to use for the │
1085 │ │ background of the binding │
1086 │ │ mode indicator │
1087 ├──────────────────────────┼────────────────────────────┤
1088 │ binding_mode_border │ The color to use for the │
1089 │ │ border of the binding mode │
1090 │ │ indicator │
1091 └──────────────────────────┴────────────────────────────┘
1092
1093 Example Reply:
1094 {
1095 "id": "bar-0",
1096 "mode": "dock",
1097 "position": "top",
1098 "status_command": "while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done",
1099 "font": "monospace 10",
1100 "gaps": {
1101 "top": 0,
1102 "right": 0,
1103 "bottom": 0,
1104 "left": 0
1105 },
1106 "bar_height": 0,
1107 "status_padding": 1,
1108 "status_edge_padding": 3,
1109 "workspace_buttons": true,
1110 "workspace_min_width": 0,
1111 "binding_mode_indicator": true,
1112 "verbose": false,
1113 "pango_markup": false,
1114 "colors": {
1115 "background": "#323232ff",
1116 "statusline": "#ffffffff",
1117 "separator": "#666666ff",
1118 "focused_background": "#323232ff",
1119 "focused_statusline": "#ffffffff",
1120 "focused_separator": "#666666ff",
1121 "focused_workspace_border": "#4c7899ff",
1122 "focused_workspace_bg": "#285577ff",
1123 "focused_workspace_text": "#ffffffff",
1124 "inactive_workspace_border": "#32323200",
1125 "inactive_workspace_bg": "#32323200",
1126 "inactive_workspace_text": "#5c5c5cff",
1127 "active_workspace_border": "#333333ff",
1128 "active_workspace_bg": "#5f676aff",
1129 "active_workspace_text": "#ffffffff",
1130 "urgent_workspace_border": "#2f343aff",
1131 "urgent_workspace_bg": "#900000ff",
1132 "urgent_workspace_text": "#ffffffff",
1133 "binding_mode_border": "#2f343aff",
1134 "binding_mode_bg": "#900000ff",
1135 "binding_mode_text": "#ffffffff"
1136 },
1137 }
1138
1139 7. GET_VERSION
1140 MESSAGE
1141 Retrieve version information about the sway process
1142
1143 REPLY
1144 An object containing the following properties:
1145
1146 ┌───────────────┬───────────┬─────────────────────┐
1147 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1148 ├───────────────┼───────────┼─────────────────────┤
1149 │ major │ integer │ The major version │
1150 │ │ │ of the sway process │
1151 ├───────────────┼───────────┼─────────────────────┤
1152 │ minor │ integer │ The minor version │
1153 │ │ │ of the sway process │
1154 ├───────────────┼───────────┼─────────────────────┤
1155 │ patch │ integer │ The patch version │
1156 │ │ │ of the sway process │
1157 ├───────────────┼───────────┼─────────────────────┤
1158 │human_readable │ string │ A human readable │
1159 │ │ │ version string that │
1160 │ │ │ will likely contain │
1161 │ │ │ more useful infor‐ │
1162 │ │ │ mation such as the │
1163 │ │ │ git commit short │
1164 │ │ │ hash and git branch │
1165 ├───────────────┼───────────┼─────────────────────┤
1166 │loaded_con‐ │ string │ The path to the │
1167 │fig_file_name │ │ loaded config file │
1168 └───────────────┴───────────┴─────────────────────┘
1169
1170 Example Reply:
1171 {
1172 "human_readable": "1.0-rc1-117-g2f7247e0 (Feb 24 2019, branch 'master')",
1173 "major": 1,
1174 "minor": 0,
1175 "patch": 0,
1176 "loaded_config_file_name": "/home/redsoxfan/.config/sway/config"
1177 }
1178
1179 8. GET_BINDING_MODES
1180 MESSAGE
1181 Retrieve the list of binding modes that currently configured
1182
1183 REPLY
1184 An array of strings, with each string being the name of a binding mode.
1185 This will always contain at least one mode (currently default), which
1186 is the default binding mode
1187
1188 Example Reply:
1189 [
1190 "default",
1191 "resize",
1192 ]
1193
1194 9. GET_CONFIG
1195 MESSAGE
1196 Retrieve the contents of the config that was last loaded
1197
1198 REPLY
1199 An object with a single string property containing the contents of the
1200 config
1201
1202 Example Reply:
1203 {
1204 "config": "set $mod Mod4nbindsym $mod+q exitn"
1205 }
1206
1207 10. SEND_TICK
1208 MESSAGE
1209 Issues a TICK event to all clients subscribing to the event to ensure
1210 that all events prior to the tick were received. If a payload is given,
1211 it will be included in the TICK event
1212
1213 REPLY
1214 A single object contains the property success, which is a boolean value
1215 indicating whether the TICK event was sent.
1216
1217 Example Reply:
1218 {
1219 "success": true
1220 }
1221
1222 11. SYNC
1223 MESSAGE
1224 For i3 compatibility, this command will just return a failure object
1225 since it does not make sense to implement in sway due to the X11 nature
1226 of the command. If you are curious about what this IPC command does in
1227 i3, refer to the i3 documentation.
1228
1229 REPLY
1230 A single object that contains the property success, which is set to the
1231 boolean value false.
1232
1233 Exact Reply:
1234 {
1235 "success": false
1236 }
1237
1238 12. GET_BINDING_STATE
1239 MESSAGE
1240 Returns the currently active binding mode.
1241
1242 REPLY
1243 A single object that contains the property name, which is set to the
1244 currently active binding mode as a string.
1245
1246 Exact Reply:
1247 {
1248 "name": "default"
1249 }
1250
1251 100. GET_INPUTS
1252 MESSAGE
1253 Retrieve a list of the input devices currently available
1254
1255 REPLY
1256 An array of objects corresponding to each input device. Each object has
1257 the following properties:
1258
1259 ┌─────────────────┬───────────┬─────────────────────┐
1260 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1261 ├─────────────────┼───────────┼─────────────────────┤
1262 │ identifier │ string │ The identifier for │
1263 │ │ │ the input device │
1264 ├─────────────────┼───────────┼─────────────────────┤
1265 │ name │ string │ The human readable │
1266 │ │ │ name for the device │
1267 ├─────────────────┼───────────┼─────────────────────┤
1268 │ vendor │ integer │ The vendor code for │
1269 │ │ │ the input device │
1270 ├─────────────────┼───────────┼─────────────────────┤
1271 │ product │ integer │ The product code │
1272 │ │ │ for the input de‐ │
1273 │ │ │ vice │
1274 ├─────────────────┼───────────┼─────────────────────┤
1275 │ type │ string │ The device type. │
1276 │ │ │ Currently this can │
1277 │ │ │ be keyboard, │
1278 │ │ │ pointer, touch, │
1279 │ │ │ tablet_tool, │
1280 │ │ │ tablet_pad, or │
1281 │ │ │ switch │
1282 ├─────────────────┼───────────┼─────────────────────┤
1283 │xkb_active_lay‐ │ string │ (Only keyboards) │
1284 │out_name │ │ The name of the ac‐ │
1285 │ │ │ tive keyboard lay‐ │
1286 │ │ │ out in use │
1287 ├─────────────────┼───────────┼─────────────────────┤
1288 │xkb_layout_names │ array │ (Only keyboards) A │
1289 │ │ │ list a layout names │
1290 │ │ │ configured for the │
1291 │ │ │ keyboard │
1292 ├─────────────────┼───────────┼─────────────────────┤
1293 │xkb_active_lay‐ │ integer │ (Only keyboards) │
1294 │out_index │ │ The index of the │
1295 │ │ │ active keyboard │
1296 │ │ │ layout in use │
1297 ├─────────────────┼───────────┼─────────────────────┤
1298 │ scroll_factor │ floating │ (Only pointers) │
1299 │ │ │ Multiplier applied │
1300 │ │ │ on scroll event │
1301 │ │ │ values. │
1302 ├─────────────────┼───────────┼─────────────────────┤
1303 │ libinput │ object │ (Only libinput de‐ │
1304 │ │ │ vices) An object │
1305 │ │ │ describing the cur‐ │
1306 │ │ │ rent device set‐ │
1307 │ │ │ tings. See below │
1308 │ │ │ for more informa‐ │
1309 │ │ │ tion │
1310 └─────────────────┴───────────┴─────────────────────┘
1311 The libinput object describes the device configuration for libinput de‐
1312 vices. Only properties that are supported for the device will be added
1313 to the object. In addition to the possible options listed, all string
1314 properties may also be unknown, in the case that a new option is added
1315 to libinput. See sway-input(5) for information on the meaning of the
1316 possible values. The following properties will be included for devices
1317 that support them:
1318
1319 ┌───────────────────┬───────────┬─────────────────────┐
1320 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1321 ├───────────────────┼───────────┼─────────────────────┤
1322 │ send_events │ string │ Whether events are │
1323 │ │ │ being sent by the │
1324 │ │ │ device. It can be │
1325 │ │ │ enabled, disabled, │
1326 │ │ │ or disabled_on_ex‐ │
1327 │ │ │ ternal_mouse │
1328 ├───────────────────┼───────────┼─────────────────────┤
1329 │ tap │ string │ Whether tap to │
1330 │ │ │ click is enabled. │
1331 │ │ │ It can be enabled │
1332 │ │ │ or disabled │
1333 ├───────────────────┼───────────┼─────────────────────┤
1334 │ tap_button_map │ string │ The finger to but‐ │
1335 │ │ │ ton mapping in use. │
1336 │ │ │ It can be lmr or │
1337 │ │ │ lrm │
1338 ├───────────────────┼───────────┼─────────────────────┤
1339 │ tap_drag │ string │ Whether tap-and- │
1340 │ │ │ drag is enabled. It │
1341 │ │ │ can be enabled or │
1342 │ │ │ disabled │
1343 ├───────────────────┼───────────┼─────────────────────┤
1344 │ tap_drag_lock │ string │ Whether drag-lock │
1345 │ │ │ is enabled. It can │
1346 │ │ │ be enabled or dis‐ │
1347 │ │ │ abled │
1348 ├───────────────────┼───────────┼─────────────────────┤
1349 │ accel_speed │ double │ The pointer-accel‐ │
1350 │ │ │ eration in use │
1351 ├───────────────────┼───────────┼─────────────────────┤
1352 │ accel_profile │ string │ The acceleration │
1353 │ │ │ profile in use. It │
1354 │ │ │ can be none, flat, │
1355 │ │ │ or adaptive │
1356 ├───────────────────┼───────────┼─────────────────────┤
1357 │ natural_scroll │ string │ Whether natural │
1358 │ │ │ scrolling is en‐ │
1359 │ │ │ abled. It can be │
1360 │ │ │ enabled or disabled │
1361 ├───────────────────┼───────────┼─────────────────────┤
1362 │ left_handed │ string │ Whether left-handed │
1363 │ │ │ mode is enabled. It │
1364 │ │ │ can be enabled or │
1365 │ │ │ disabled │
1366 ├───────────────────┼───────────┼─────────────────────┤
1367 │ click_method │ string │ The click method in │
1368 │ │ │ use. It can be │
1369 │ │ │ none, button_areas, │
1370 │ │ │ or clickfinger │
1371 ├───────────────────┼───────────┼─────────────────────┤
1372 │ middle_emulation │ string │ Whether middle emu‐ │
1373 │ │ │ lation is enabled. │
1374 │ │ │ It can be enabled │
1375 │ │ │ or disabled │
1376 ├───────────────────┼───────────┼─────────────────────┤
1377 │ scroll_method │ string │ The scroll method │
1378 │ │ │ in use. It can be │
1379 │ │ │ none, two_finger, │
1380 │ │ │ edge, or on_but‐ │
1381 │ │ │ ton_down │
1382 ├───────────────────┼───────────┼─────────────────────┤
1383 │ scroll_button │ int │ The scroll button │
1384 │ │ │ to use when │
1385 │ │ │ scroll_method is │
1386 │ │ │ on_button_down. │
1387 │ │ │ This will be given │
1388 │ │ │ as an input event │
1389 │ │ │ code │
1390 ├───────────────────┼───────────┼─────────────────────┤
1391 │ dwt │ string │ Whether disable- │
1392 │ │ │ while-typing is en‐ │
1393 │ │ │ abled. It can be │
1394 │ │ │ enabled or disabled │
1395 ├───────────────────┼───────────┼─────────────────────┤
1396 │calibration_matrix │ array │ An array of 6 │
1397 │ │ │ floats representing │
1398 │ │ │ the calibration ma‐ │
1399 │ │ │ trix for absolute │
1400 │ │ │ devices such as │
1401 │ │ │ touchscreens │
1402 └───────────────────┴───────────┴─────────────────────┘
1403
1404 Example Reply:
1405 [
1406 {
1407 "identifier": "1:1:AT_Translated_Set_2_keyboard",
1408 "name": "AT Translated Set 2 keyboard",
1409 "vendor": 1,
1410 "product": 1,
1411 "type": "keyboard",
1412 "xkb_active_layout_name": "English (US)",
1413 "libinput": {
1414 "send_events": "enabled"
1415 }
1416 },
1417 {
1418 "identifier": "1267:5:Elan_Touchpad",
1419 "name": "Elan Touchpad",
1420 "vendor": 1267,
1421 "product": 5,
1422 "type": "pointer",
1423 "libinput": {
1424 "send_events": "enabled",
1425 "tap": "enabled",
1426 "tap_button_map": "lmr",
1427 "tap_drag": "enabled",
1428 "tap_drag_lock": "disabled",
1429 "accel_speed": 0.0,
1430 "accel_profile": "none",
1431 "natural_scroll", "disabled",
1432 "left_handed": "disabled",
1433 "click_method": "button_areas",
1434 "middle_emulation": "disabled",
1435 "scroll_method": "edge",
1436 "dwt": "enabled"
1437 }
1438 },
1439 {
1440 "identifier": "3034:22494:USB2.0_VGA_UVC_WebCam:_USB2.0_V",
1441 "name": "USB2.0 VGA UVC WebCam: USB2.0 V",
1442 "vendor": 3034,
1443 "product": 22494,
1444 "type": "keyboard",
1445 "xkb_active_layout_name": "English (US)",
1446 "libinput": {
1447 "send_events": "enabled"
1448 }
1449 },
1450 {
1451 "identifier": "0:3:Sleep_Button",
1452 "name": "Sleep Button",
1453 "vendor": 0,
1454 "product": 3,
1455 "type": "keyboard",
1456 "xkb_active_layout_name": "English (US)",
1457 "libinput": {
1458 "send_events": "enabled"
1459 }
1460 },
1461 {
1462 "identifier": "0:5:Lid_Switch",
1463 "name": "Lid Switch",
1464 "vendor": 0,
1465 "product": 5,
1466 "type": "switch",
1467 "libinput": {
1468 "send_events": "enabled"
1469 }
1470 },
1471 {
1472 "identifier": "0:6:Video_Bus",
1473 "name": "Video Bus",
1474 "vendor": 0,
1475 "product": 6,
1476 "type": "keyboard",
1477 "xkb_active_layout_name": "English (US)",
1478 "libinput": {
1479 "send_events": "enabled"
1480 }
1481 },
1482 {
1483 "identifier": "0:1:Power_Button",
1484 "name": "Power Button",
1485 "vendor": 0,
1486 "product": 1,
1487 "type": "keyboard",
1488 "xkb_active_layout_name": "English (US)",
1489 "libinput": {
1490 "send_events": "enabled"
1491 }
1492 }
1493 ]
1494
1495 101. GET_SEATS
1496 MESSAGE
1497 Retrieve a list of the seats currently configured
1498
1499 REPLY
1500 An array of objects corresponding to each seat. There will always be at
1501 least one seat. Each object has the following properties:
1502
1503 ┌─────────────┬───────────┬─────────────────────┐
1504 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1505 ├─────────────┼───────────┼─────────────────────┤
1506 │ name │ string │ The unique name for │
1507 │ │ │ the seat │
1508 ├─────────────┼───────────┼─────────────────────┤
1509 │capabilities │ integer │ The number of capa‐ │
1510 │ │ │ bilities that the │
1511 │ │ │ seat has │
1512 ├─────────────┼───────────┼─────────────────────┤
1513 │ focus │ integer │ The id of the node │
1514 │ │ │ currently focused │
1515 │ │ │ by the seat or 0 │
1516 │ │ │ when the seat is │
1517 │ │ │ not currently fo‐ │
1518 │ │ │ cused by a node │
1519 │ │ │ (i.e. a surface │
1520 │ │ │ layer or xwayland │
1521 │ │ │ unmanaged has fo‐ │
1522 │ │ │ cus) │
1523 ├─────────────┼───────────┼─────────────────────┤
1524 │ devices │ array │ An array of input │
1525 │ │ │ devices that are │
1526 │ │ │ attached to the │
1527 │ │ │ seat. Currently, │
1528 │ │ │ this is an array of │
1529 │ │ │ objects that are │
1530 │ │ │ identical to those │
1531 │ │ │ returned by GET_IN‐ │
1532 │ │ │ PUTS │
1533 └─────────────┴───────────┴─────────────────────┘
1534
1535 Example Reply:
1536 [
1537 {
1538 "name": "seat0",
1539 "capabilities": 3,
1540 "focus": 7,
1541 "devices": [
1542 {
1543 "identifier": "1:1:AT_Translated_Set_2_keyboard",
1544 "name": "AT Translated Set 2 keyboard",
1545 "vendor": 1,
1546 "product": 1,
1547 "type": "keyboard",
1548 "xkb_active_layout_name": "English (US)",
1549 "libinput": {
1550 "send_events": "enabled"
1551 }
1552 },
1553 {
1554 "identifier": "1267:5:Elan_Touchpad",
1555 "name": "Elan Touchpad",
1556 "vendor": 1267,
1557 "product": 5,
1558 "type": "pointer",
1559 "libinput": {
1560 "send_events": "enabled",
1561 "tap": "enabled",
1562 "tap_button_map": "lmr",
1563 "tap_drag": "enabled",
1564 "tap_drag_lock": "disabled",
1565 "accel_speed": 0.0,
1566 "accel_profile": "none",
1567 "natural_scroll", "disabled",
1568 "left_handed": "disabled",
1569 "click_method": "button_areas",
1570 "middle_emulation": "disabled",
1571 "scroll_method": "edge",
1572 "dwt": "enabled"
1573 }
1574 },
1575 {
1576 "identifier": "3034:22494:USB2.0_VGA_UVC_WebCam:_USB2.0_V",
1577 "name": "USB2.0 VGA UVC WebCam: USB2.0 V",
1578 "vendor": 3034,
1579 "product": 22494,
1580 "type": "keyboard",
1581 "xkb_active_layout_name": "English (US)",
1582 "libinput": {
1583 "send_events": "enabled"
1584 }
1585 },
1586 {
1587 "identifier": "0:3:Sleep_Button",
1588 "name": "Sleep Button",
1589 "vendor": 0,
1590 "product": 3,
1591 "type": "keyboard",
1592 "xkb_active_layout_name": "English (US)",
1593 "libinput": {
1594 "send_events": "enabled"
1595 }
1596 },
1597 {
1598 "identifier": "0:5:Lid_Switch",
1599 "name": "Lid Switch",
1600 "vendor": 0,
1601 "product": 5,
1602 "type": "switch",
1603 "libinput": {
1604 "send_events": "enabled"
1605 }
1606 },
1607 {
1608 "identifier": "0:6:Video_Bus",
1609 "name": "Video Bus",
1610 "vendor": 0,
1611 "product": 6,
1612 "type": "keyboard",
1613 "xkb_active_layout_name": "English (US)",
1614 "libinput": {
1615 "send_events": "enabled"
1616 }
1617 },
1618 {
1619 "identifier": "0:1:Power_Button",
1620 "name": "Power Button",
1621 "vendor": 0,
1622 "product": 1,
1623 "type": "keyboard",
1624 "xkb_active_layout_name": "English (US)",
1625 "libinput": {
1626 "send_events": "enabled"
1627 }
1628 }
1629 ]
1630 }
1631 ]
1632
1634 Events are a way for client to get notified of changes to sway. A
1635 client can subscribe to any events it wants to be notified of changes
1636 for. The event is sent in the same format as a reply. The following
1637 events are currently available:
1638
1639 ┌───────────┬──────────────────┬─────────────────────┐
1640 │EVENT TYPE │ NAME │ DESCRIPTION │
1641 ├───────────┼──────────────────┼─────────────────────┤
1642 │0x80000000 │ workspace │ Sent whenever an │
1643 │ │ │ event involving a │
1644 │ │ │ workspace occurs │
1645 │ │ │ such as initializa‐ │
1646 │ │ │ tion of a new │
1647 │ │ │ workspace or a dif‐ │
1648 │ │ │ ferent workspace │
1649 │ │ │ gains focus │
1650 ├───────────┼──────────────────┼─────────────────────┤
1651 │0x80000002 │ mode │ Sent whenever the │
1652 │ │ │ binding mode │
1653 │ │ │ changes │
1654 ├───────────┼──────────────────┼─────────────────────┤
1655 │0x80000003 │ window │ Sent whenever an │
1656 │ │ │ event involving a │
1657 │ │ │ view occurs such as │
1658 │ │ │ being reparented, │
1659 │ │ │ focused, or closed │
1660 ├───────────┼──────────────────┼─────────────────────┤
1661 │0x80000004 │ barconfig_update │ Sent whenever a bar │
1662 │ │ │ config changes │
1663 ├───────────┼──────────────────┼─────────────────────┤
1664 │0x80000005 │ binding │ Sent when a config‐ │
1665 │ │ │ ured binding is ex‐ │
1666 │ │ │ ecuted │
1667 ├───────────┼──────────────────┼─────────────────────┤
1668 │0x80000006 │ shutdown │ Sent when the ipc │
1669 │ │ │ shuts down because │
1670 │ │ │ sway is exiting │
1671 ├───────────┼──────────────────┼─────────────────────┤
1672 │0x80000007 │ tick │ Sent when an ipc │
1673 │ │ │ client sends a │
1674 │ │ │ SEND_TICK message │
1675 ├───────────┼──────────────────┼─────────────────────┤
1676 │0x80000014 │ bar_state_update │ Send when the visi‐ │
1677 │ │ │ bility of a bar │
1678 │ │ │ should change due │
1679 │ │ │ to a modifier │
1680 ├───────────┼──────────────────┼─────────────────────┤
1681 │0x80000015 │ input │ Sent when something │
1682 │ │ │ related to input │
1683 │ │ │ devices changes │
1684 └───────────┴──────────────────┴─────────────────────┘
1685
1686 0x80000000. WORKSPACE
1687 Sent whenever a change involving a workspace occurs. The event consists
1688 of a single object with the following properties:
1689
1690 ┌─────────┬───────────┬─────────────────────┐
1691 │PROPERTY │ DATA TYPE │ DESCRIPTION │
1692 ├─────────┼───────────┼─────────────────────┤
1693 │ change │ string │ The type of change │
1694 │ │ │ that occurred. See │
1695 │ │ │ below for more in‐ │
1696 │ │ │ formation │
1697 ├─────────┼───────────┼─────────────────────┤
1698 │current │ object │ An object repre‐ │
1699 │ │ │ senting the │
1700 │ │ │ workspace effected │
1701 │ │ │ or null for reload │
1702 │ │ │ changes │
1703 ├─────────┼───────────┼─────────────────────┤
1704 │ old │ object │ For a focus change, │
1705 │ │ │ this is will be an │
1706 │ │ │ object representing │
1707 │ │ │ the workspace being │
1708 │ │ │ switched from. Oth‐ │
1709 │ │ │ erwise, it is null │
1710 └─────────┴───────────┴─────────────────────┘
1711
1712 The following change types are currently available:
1713
1714 ┌───────┬────────────────────────────┐
1715 │ TYPE │ DESCRIPTION │
1716 ├───────┼────────────────────────────┤
1717 │ init │ The workspace was created │
1718 ├───────┼────────────────────────────┤
1719 │empty │ The workspace is empty and │
1720 │ │ is being destroyed since │
1721 │ │ it is not visible │
1722 ├───────┼────────────────────────────┤
1723 │focus │ The workspace was focused. │
1724 │ │ See the old property for │
1725 │ │ the previous focus │
1726 ├───────┼────────────────────────────┤
1727 │ move │ The workspace was moved to │
1728 │ │ a different output │
1729 ├───────┼────────────────────────────┤
1730 │rename │ The workspace was renamed │
1731 ├───────┼────────────────────────────┤
1732 │urgent │ A view on the workspace │
1733 │ │ has had their urgency hint │
1734 │ │ set or all urgency hints │
1735 │ │ for views on the workspace │
1736 │ │ have been cleared │
1737 ├───────┼────────────────────────────┤
1738 │reload │ The configuration file has │
1739 │ │ been reloaded │
1740 └───────┴────────────────────────────┘
1741
1742 Example Event:
1743 {
1744 "change": "init",
1745 "old": null,
1746 "current": {
1747 "id": 10,
1748 "name": "2",
1749 "rect": {
1750 "x": 0,
1751 "y": 0,
1752 "width": 0,
1753 "height": 0
1754 },
1755 "focused": false,
1756 "focus": [
1757 ],
1758 "border": "none",
1759 "current_border_width": 0,
1760 "layout": "splith",
1761 "percent": null,
1762 "window_rect": {
1763 "x": 0,
1764 "y": 0,
1765 "width": 0,
1766 "height": 0
1767 },
1768 "deco_rect": {
1769 "x": 0,
1770 "y": 0,
1771 "width": 0,
1772 "height": 0
1773 },
1774 "geometry": {
1775 "x": 0,
1776 "y": 0,
1777 "width": 0,
1778 "height": 0
1779 },
1780 "window": null,
1781 "urgent": false,
1782 "floating_nodes": [
1783 ],
1784 "num": 2,
1785 "output": "eDP-1",
1786 "type": "workspace",
1787 "representation": null,
1788 "nodes": [
1789 ]
1790 }
1791 }
1792
1793 0x80000002. MODE
1794 Sent whenever the binding mode changes. The event consists of a single
1795 object with the following properties:
1796
1797 ┌─────────────┬───────────┬─────────────────────┐
1798 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1799 ├─────────────┼───────────┼─────────────────────┤
1800 │ change │ string │ The binding mode │
1801 │ │ │ that became active │
1802 ├─────────────┼───────────┼─────────────────────┤
1803 │pango_markup │ boolean │ Whether the mode │
1804 │ │ │ should be parsed as │
1805 │ │ │ pango markup │
1806 └─────────────┴───────────┴─────────────────────┘
1807
1808 Example Event:
1809 {
1810 "change": "default",
1811 "pango_markup": false
1812 }
1813
1814 0x80000003. WINDOW
1815 Sent whenever a change involving a view occurs. The event consists of a
1816 single object with the following properties:
1817
1818 ┌──────────┬───────────┬────────────────────┐
1819 │PROPERTY │ DATA TYPE │ DESCRIPTION │
1820 ├──────────┼───────────┼────────────────────┤
1821 │ change │ string │ The type of change │
1822 │ │ │ that occurred. See │
1823 │ │ │ below for more in‐ │
1824 │ │ │ formation │
1825 ├──────────┼───────────┼────────────────────┤
1826 │container │ object │ An object repre‐ │
1827 │ │ │ senting the view │
1828 │ │ │ effected │
1829 └──────────┴───────────┴────────────────────┘
1830
1831 The following change types are currently available:
1832
1833 ┌────────────────┬────────────────────────────┐
1834 │ TYPE │ DESCRIPTION │
1835 ├────────────────┼────────────────────────────┤
1836 │ new │ The view was created │
1837 ├────────────────┼────────────────────────────┤
1838 │ close │ The view was closed │
1839 ├────────────────┼────────────────────────────┤
1840 │ focus │ The view was focused │
1841 ├────────────────┼────────────────────────────┤
1842 │ title │ The view's title has │
1843 │ │ changed │
1844 ├────────────────┼────────────────────────────┤
1845 │fullscreen_mode │ The view's fullscreen mode │
1846 │ │ has changed │
1847 ├────────────────┼────────────────────────────┤
1848 │ move │ The view has been repar‐ │
1849 │ │ ented in the tree │
1850 ├────────────────┼────────────────────────────┤
1851 │ floating │ The view has become float‐ │
1852 │ │ ing or is no longer float‐ │
1853 │ │ ing │
1854 ├────────────────┼────────────────────────────┤
1855 │ urgent │ The view's urgency hint │
1856 │ │ has changed status │
1857 ├────────────────┼────────────────────────────┤
1858 │ mark │ A mark has been added or │
1859 │ │ removed from the view │
1860 └────────────────┴────────────────────────────┘
1861
1862 Example Event:
1863 {
1864 "change": "new",
1865 "container": {
1866 "id": 12,
1867 "name": null,
1868 "rect": {
1869 "x": 0,
1870 "y": 0,
1871 "width": 0,
1872 "height": 0
1873 },
1874 "focused": false,
1875 "focus": [
1876 ],
1877 "border": "none",
1878 "current_border_width": 0,
1879 "layout": "none",
1880 "percent": 0.0,
1881 "window_rect": {
1882 "x": 0,
1883 "y": 0,
1884 "width": 0,
1885 "height": 0
1886 },
1887 "deco_rect": {
1888 "x": 0,
1889 "y": 0,
1890 "width": 0,
1891 "height": 0
1892 },
1893 "geometry": {
1894 "x": 0,
1895 "y": 0,
1896 "width": 1124,
1897 "height": 422
1898 },
1899 "window": 4194313,
1900 "urgent": false,
1901 "floating_nodes": [
1902 ],
1903 "type": "con",
1904 "pid": 19787,
1905 "app_id": null,
1906 "window_properties": {
1907 "class": "URxvt",
1908 "instance": "urxvt",
1909 "transient_for": null
1910 },
1911 "nodes": [
1912 ]
1913 }
1914 }
1915
1916 0x80000004. BARCONFIG_UPDATE
1917 Sent whenever a config for a bar changes. The event is identical to
1918 that of GET_BAR_CONFIG when a bar ID is given as a payload. See 6.
1919 GET_BAR_CONFIG (WITH A PAYLOAD) above for more information.
1920
1921 0x80000005. BINDING
1922 Sent whenever a binding is executed. The event is a single object with
1923 the following properties:
1924
1925 ┌─────────────────┬───────────┬─────────────────────┐
1926 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1927 ├─────────────────┼───────────┼─────────────────────┤
1928 │ change │ string │ The change that oc‐ │
1929 │ │ │ curred for the │
1930 │ │ │ binding. Currently │
1931 │ │ │ this will only be │
1932 │ │ │ run │
1933 ├─────────────────┼───────────┼─────────────────────┤
1934 │ command │ string │ The command associ‐ │
1935 │ │ │ ated with the bind‐ │
1936 │ │ │ ing │
1937 ├─────────────────┼───────────┼─────────────────────┤
1938 │event_state_mask │ array │ An array of strings │
1939 │ │ │ that correspond to │
1940 │ │ │ each modifier key │
1941 │ │ │ for the binding │
1942 ├─────────────────┼───────────┼─────────────────────┤
1943 │ input_code │ integer │ For keyboard bind‐ │
1944 │ │ │ codes, this is the │
1945 │ │ │ key code for the │
1946 │ │ │ binding. For mouse │
1947 │ │ │ bindings, this is │
1948 │ │ │ the X11 button num‐ │
1949 │ │ │ ber, if there is an │
1950 │ │ │ equivalent. In all │
1951 │ │ │ other cases, this │
1952 │ │ │ will be 0. │
1953 ├─────────────────┼───────────┼─────────────────────┤
1954 │ symbol │ string │ For keyboard │
1955 │ │ │ bindsyms, this is │
1956 │ │ │ the bindsym for the │
1957 │ │ │ binding. Otherwise, │
1958 │ │ │ this will be null │
1959 ├─────────────────┼───────────┼─────────────────────┤
1960 │ input_type │ string │ The input type that │
1961 │ │ │ triggered the bind‐ │
1962 │ │ │ ing. This is either │
1963 │ │ │ keyboard or mouse │
1964 └─────────────────┴───────────┴─────────────────────┘
1965
1966 Example Event:
1967 {
1968 "change": "run",
1969 "binding": {
1970 "command": "workspace 2",
1971 "event_state_mask": [
1972 "Mod4"
1973 ],
1974 "input_code": 0,
1975 "symbol": "2",
1976 "input_type": "keyboard"
1977 }
1978 }
1979
1980 0x80000006. SHUTDOWN
1981 Sent whenever the IPC is shutting down. The event is a single object
1982 with the property change, which is a string containing the reason for
1983 the shutdown. Currently, the only value for change is exit, which is
1984 issued when sway is exiting.
1985
1986 Example Event:
1987 {
1988 "change": "exit"
1989 }
1990
1991 0x80000007. TICK
1992 Sent when first subscribing to tick events or by a SEND_TICK message.
1993 The event is a single object with the following properties:
1994
1995 ┌─────────┬───────────┬─────────────────────┐
1996 │PROPERTY │ DATA TYPE │ DESCRIPTION │
1997 ├─────────┼───────────┼─────────────────────┤
1998 │ first │ boolean │ Whether this event │
1999 │ │ │ was triggered by │
2000 │ │ │ subscribing to the │
2001 │ │ │ tick events │
2002 ├─────────┼───────────┼─────────────────────┤
2003 │payload │ string │ The payload given │
2004 │ │ │ with a SEND_TICK │
2005 │ │ │ message, if any. │
2006 │ │ │ Otherwise, an empty │
2007 │ │ │ string │
2008 └─────────┴───────────┴─────────────────────┘
2009
2010 Example Event:
2011 {
2012 "first": true
2013 "payload": ""
2014 }
2015
2016 0x80000014. BAR_STATE_UPDATE
2017 Sent when the visibility of a bar changes due to a modifier being
2018 pressed. The event is a single object with the following properties:
2019
2020 ┌────────────────────┬───────────┬─────────────────────┐
2021 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
2022 ├────────────────────┼───────────┼─────────────────────┤
2023 │ id │ string │ The bar ID effected │
2024 ├────────────────────┼───────────┼─────────────────────┤
2025 │visible_by_modifier │ boolean │ Whether the bar │
2026 │ │ │ should be made vis‐ │
2027 │ │ │ ible due to a modi‐ │
2028 │ │ │ fier being pressed │
2029 └────────────────────┴───────────┴─────────────────────┘
2030
2031 Example Event:
2032 {
2033 "id": "bar-0",
2034 "visible_by_modifier": true
2035 }
2036
2037 0x80000015. INPUT
2038 Sent when something related to the input devices changes. The event is
2039 a single object with the following properties:
2040
2041 ┌─────────┬───────────┬─────────────────────┐
2042 │PROPERTY │ DATA TYPE │ DESCRIPTION │
2043 ├─────────┼───────────┼─────────────────────┤
2044 │ change │ string │ What has changed │
2045 ├─────────┼───────────┼─────────────────────┤
2046 │ input │ object │ An object repre‐ │
2047 │ │ │ senting the input │
2048 │ │ │ that is identical │
2049 │ │ │ the ones GET_INPUTS │
2050 │ │ │ gives │
2051 └─────────┴───────────┴─────────────────────┘
2052 The following change types are currently available:
2053
2054 ┌────────────────┬────────────────────────────┐
2055 │ TYPE │ DESCRIPTION │
2056 ├────────────────┼────────────────────────────┤
2057 │ added │ The input device became │
2058 │ │ available │
2059 ├────────────────┼────────────────────────────┤
2060 │ removed │ The input device is no │
2061 │ │ longer available │
2062 ├────────────────┼────────────────────────────┤
2063 │ xkb_keymap │ (Keyboards only) The │
2064 │ │ keymap for the keyboard │
2065 │ │ has changed │
2066 ├────────────────┼────────────────────────────┤
2067 │ xkb_layout │ (Keyboards only) The ef‐ │
2068 │ │ fective layout in the │
2069 │ │ keymap has changed │
2070 ├────────────────┼────────────────────────────┤
2071 │libinput_config │ (libinput device only) A │
2072 │ │ libinput config option for │
2073 │ │ the device changed │
2074 └────────────────┴────────────────────────────┘
2075 Example Event:
2076 {
2077 "change": "xkb_layout",
2078 "input": {
2079 "identifier": "1:1:AT_Translated_Set_2_keyboard",
2080 "name": "AT Translated Set 2 keyboard",
2081 "vendor": 1,
2082 "product": 1,
2083 "type": "keyboard",
2084 "xkb_layout_names": [
2085 "English (US)",
2086 "English (Dvorak)"
2087 ],
2088 "xkb_active_layout_index": 1,
2089 "xkb_active_layout_name": "English (Dvorak)",
2090 "libinput": {
2091 "send_events": "enabled"
2092 }
2093 }
2094 }
2095
2097 sway(1) sway(5) sway-bar(5) swaymsg(1) sway-input(5) sway-output(5)
2098
2099
2100
2101 2022-11-14 sway-ipc(7)