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