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 object the 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 │ libinput │ object │ (Only libinput de‐ │
1299 │ │ │ vices) An object │
1300 │ │ │ describing the cur‐ │
1301 │ │ │ rent device set‐ │
1302 │ │ │ tings. See below │
1303 │ │ │ for more informa‐ │
1304 │ │ │ tion │
1305 └─────────────────┴───────────┴─────────────────────┘
1306 The libinput object describes the device configuration for libinput de‐
1307 vices. Only properties that are supported for the device will be added
1308 to the object. In addition to the possible options listed, all string
1309 properties may also be unknown, in the case that a new option is added
1310 to libinput. See sway-input(5) for information on the meaning of the
1311 possible values. The following properties will be included for devices
1312 that support them:
1313
1314 ┌───────────────────┬───────────┬─────────────────────┐
1315 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1316 ├───────────────────┼───────────┼─────────────────────┤
1317 │ send_events │ string │ Whether events are │
1318 │ │ │ being sent by the │
1319 │ │ │ device. It can be │
1320 │ │ │ enabled, disabled, │
1321 │ │ │ or disabled_on_ex‐ │
1322 │ │ │ ternal_mouse │
1323 ├───────────────────┼───────────┼─────────────────────┤
1324 │ tap │ string │ Whether tap to │
1325 │ │ │ click is enabled. │
1326 │ │ │ It can be enabled │
1327 │ │ │ or disabled │
1328 ├───────────────────┼───────────┼─────────────────────┤
1329 │ tap_button_map │ string │ The finger to but‐ │
1330 │ │ │ ton mapping in use. │
1331 │ │ │ It can be lmr or │
1332 │ │ │ lrm │
1333 ├───────────────────┼───────────┼─────────────────────┤
1334 │ tap_drag │ string │ Whether tap-and- │
1335 │ │ │ drag is enabled. It │
1336 │ │ │ can be enabled or │
1337 │ │ │ disabled │
1338 ├───────────────────┼───────────┼─────────────────────┤
1339 │ tap_drag_lock │ string │ Whether drag-lock │
1340 │ │ │ is enabled. It can │
1341 │ │ │ be enabled or dis‐ │
1342 │ │ │ abled │
1343 ├───────────────────┼───────────┼─────────────────────┤
1344 │ accel_speed │ double │ The pointer-accel‐ │
1345 │ │ │ eration in use │
1346 ├───────────────────┼───────────┼─────────────────────┤
1347 │ accel_profile │ string │ The acceleration │
1348 │ │ │ profile in use. It │
1349 │ │ │ can be none, flat, │
1350 │ │ │ or adaptive │
1351 ├───────────────────┼───────────┼─────────────────────┤
1352 │ natural_scroll │ string │ Whether natural │
1353 │ │ │ scrolling is en‐ │
1354 │ │ │ abled. It can be │
1355 │ │ │ enabled or disabled │
1356 ├───────────────────┼───────────┼─────────────────────┤
1357 │ left_handed │ string │ Whether left-handed │
1358 │ │ │ mode is enabled. It │
1359 │ │ │ can be enabled or │
1360 │ │ │ disabled │
1361 ├───────────────────┼───────────┼─────────────────────┤
1362 │ click_method │ string │ The click method in │
1363 │ │ │ use. It can be │
1364 │ │ │ none, button_areas, │
1365 │ │ │ or clickfinger │
1366 ├───────────────────┼───────────┼─────────────────────┤
1367 │ middle_emulation │ string │ Whether middle emu‐ │
1368 │ │ │ lation is enabled. │
1369 │ │ │ It can be enabled │
1370 │ │ │ or disabled │
1371 ├───────────────────┼───────────┼─────────────────────┤
1372 │ scroll_method │ string │ The scroll method │
1373 │ │ │ in use. It can be │
1374 │ │ │ none, two_finger, │
1375 │ │ │ edge, or on_but‐ │
1376 │ │ │ ton_down │
1377 ├───────────────────┼───────────┼─────────────────────┤
1378 │ scroll_button │ int │ The scroll button │
1379 │ │ │ to use when │
1380 │ │ │ scroll_method is │
1381 │ │ │ on_button_down. │
1382 │ │ │ This will be given │
1383 │ │ │ as an input event │
1384 │ │ │ code │
1385 ├───────────────────┼───────────┼─────────────────────┤
1386 │ dwt │ string │ Whether disable- │
1387 │ │ │ while-typing is en‐ │
1388 │ │ │ abled. It can be │
1389 │ │ │ enabled or disabled │
1390 ├───────────────────┼───────────┼─────────────────────┤
1391 │calibration_matrix │ array │ An array of 6 │
1392 │ │ │ floats representing │
1393 │ │ │ the calibration ma‐ │
1394 │ │ │ trix for absolute │
1395 │ │ │ devices such as │
1396 │ │ │ touchscreens │
1397 └───────────────────┴───────────┴─────────────────────┘
1398
1399 Example Reply:
1400 [
1401 {
1402 "identifier": "1:1:AT_Translated_Set_2_keyboard",
1403 "name": "AT Translated Set 2 keyboard",
1404 "vendor": 1,
1405 "product": 1,
1406 "type": "keyboard",
1407 "xkb_active_layout_name": "English (US)",
1408 "libinput": {
1409 "send_events": "enabled"
1410 }
1411 },
1412 {
1413 "identifier": "1267:5:Elan_Touchpad",
1414 "name": "Elan Touchpad",
1415 "vendor": 1267,
1416 "product": 5,
1417 "type": "pointer",
1418 "libinput": {
1419 "send_events": "enabled",
1420 "tap": "enabled",
1421 "tap_button_map": "lmr",
1422 "tap_drag": "enabled",
1423 "tap_drag_lock": "disabled",
1424 "accel_speed": 0.0,
1425 "accel_profile": "none",
1426 "natural_scroll", "disabled",
1427 "left_handed": "disabled",
1428 "click_method": "button_areas",
1429 "middle_emulation": "disabled",
1430 "scroll_method": "edge",
1431 "dwt": "enabled"
1432 }
1433 },
1434 {
1435 "identifier": "3034:22494:USB2.0_VGA_UVC_WebCam:_USB2.0_V",
1436 "name": "USB2.0 VGA UVC WebCam: USB2.0 V",
1437 "vendor": 3034,
1438 "product": 22494,
1439 "type": "keyboard",
1440 "xkb_active_layout_name": "English (US)",
1441 "libinput": {
1442 "send_events": "enabled"
1443 }
1444 },
1445 {
1446 "identifier": "0:3:Sleep_Button",
1447 "name": "Sleep Button",
1448 "vendor": 0,
1449 "product": 3,
1450 "type": "keyboard",
1451 "xkb_active_layout_name": "English (US)",
1452 "libinput": {
1453 "send_events": "enabled"
1454 }
1455 },
1456 {
1457 "identifier": "0:5:Lid_Switch",
1458 "name": "Lid Switch",
1459 "vendor": 0,
1460 "product": 5,
1461 "type": "switch",
1462 "libinput": {
1463 "send_events": "enabled"
1464 }
1465 },
1466 {
1467 "identifier": "0:6:Video_Bus",
1468 "name": "Video Bus",
1469 "vendor": 0,
1470 "product": 6,
1471 "type": "keyboard",
1472 "xkb_active_layout_name": "English (US)",
1473 "libinput": {
1474 "send_events": "enabled"
1475 }
1476 },
1477 {
1478 "identifier": "0:1:Power_Button",
1479 "name": "Power Button",
1480 "vendor": 0,
1481 "product": 1,
1482 "type": "keyboard",
1483 "xkb_active_layout_name": "English (US)",
1484 "libinput": {
1485 "send_events": "enabled"
1486 }
1487 }
1488 ]
1489
1490 101. GET_SEATS
1491 MESSAGE
1492 Retrieve a list of the seats currently configured
1493
1494 REPLY
1495 An array of objects corresponding to each seat. There will always be at
1496 least one seat. Each object has the following properties:
1497
1498 ┌─────────────┬───────────┬─────────────────────┐
1499 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1500 ├─────────────┼───────────┼─────────────────────┤
1501 │ name │ string │ The unique name for │
1502 │ │ │ the seat │
1503 ├─────────────┼───────────┼─────────────────────┤
1504 │capabilities │ integer │ The number of capa‐ │
1505 │ │ │ bilities that the │
1506 │ │ │ seat has │
1507 ├─────────────┼───────────┼─────────────────────┤
1508 │ focus │ integer │ The id of the node │
1509 │ │ │ currently focused │
1510 │ │ │ by the seat or 0 │
1511 │ │ │ when the seat is │
1512 │ │ │ not currently fo‐ │
1513 │ │ │ cused by a node │
1514 │ │ │ (i.e. a surface │
1515 │ │ │ layer or xwayland │
1516 │ │ │ unmanaged has fo‐ │
1517 │ │ │ cus) │
1518 ├─────────────┼───────────┼─────────────────────┤
1519 │ devices │ array │ An array of input │
1520 │ │ │ devices that are │
1521 │ │ │ attached to the │
1522 │ │ │ seat. Currently, │
1523 │ │ │ this is an array of │
1524 │ │ │ objects that are │
1525 │ │ │ identical to those │
1526 │ │ │ returned by GET_IN‐ │
1527 │ │ │ PUTS │
1528 └─────────────┴───────────┴─────────────────────┘
1529
1530 Example Reply:
1531 [
1532 {
1533 "name": "seat0",
1534 "capabilities": 3,
1535 "focus": 7,
1536 "devices": [
1537 {
1538 "identifier": "1:1:AT_Translated_Set_2_keyboard",
1539 "name": "AT Translated Set 2 keyboard",
1540 "vendor": 1,
1541 "product": 1,
1542 "type": "keyboard",
1543 "xkb_active_layout_name": "English (US)",
1544 "libinput": {
1545 "send_events": "enabled"
1546 }
1547 },
1548 {
1549 "identifier": "1267:5:Elan_Touchpad",
1550 "name": "Elan Touchpad",
1551 "vendor": 1267,
1552 "product": 5,
1553 "type": "pointer",
1554 "libinput": {
1555 "send_events": "enabled",
1556 "tap": "enabled",
1557 "tap_button_map": "lmr",
1558 "tap_drag": "enabled",
1559 "tap_drag_lock": "disabled",
1560 "accel_speed": 0.0,
1561 "accel_profile": "none",
1562 "natural_scroll", "disabled",
1563 "left_handed": "disabled",
1564 "click_method": "button_areas",
1565 "middle_emulation": "disabled",
1566 "scroll_method": "edge",
1567 "dwt": "enabled"
1568 }
1569 },
1570 {
1571 "identifier": "3034:22494:USB2.0_VGA_UVC_WebCam:_USB2.0_V",
1572 "name": "USB2.0 VGA UVC WebCam: USB2.0 V",
1573 "vendor": 3034,
1574 "product": 22494,
1575 "type": "keyboard",
1576 "xkb_active_layout_name": "English (US)",
1577 "libinput": {
1578 "send_events": "enabled"
1579 }
1580 },
1581 {
1582 "identifier": "0:3:Sleep_Button",
1583 "name": "Sleep Button",
1584 "vendor": 0,
1585 "product": 3,
1586 "type": "keyboard",
1587 "xkb_active_layout_name": "English (US)",
1588 "libinput": {
1589 "send_events": "enabled"
1590 }
1591 },
1592 {
1593 "identifier": "0:5:Lid_Switch",
1594 "name": "Lid Switch",
1595 "vendor": 0,
1596 "product": 5,
1597 "type": "switch",
1598 "libinput": {
1599 "send_events": "enabled"
1600 }
1601 },
1602 {
1603 "identifier": "0:6:Video_Bus",
1604 "name": "Video Bus",
1605 "vendor": 0,
1606 "product": 6,
1607 "type": "keyboard",
1608 "xkb_active_layout_name": "English (US)",
1609 "libinput": {
1610 "send_events": "enabled"
1611 }
1612 },
1613 {
1614 "identifier": "0:1:Power_Button",
1615 "name": "Power Button",
1616 "vendor": 0,
1617 "product": 1,
1618 "type": "keyboard",
1619 "xkb_active_layout_name": "English (US)",
1620 "libinput": {
1621 "send_events": "enabled"
1622 }
1623 }
1624 ]
1625 }
1626 ]
1627
1629 Events are a way for client to get notified of changes to sway. A
1630 client can subscribe to any events it wants to be notified of changes
1631 for. The event is sent in the same format as a reply. The following
1632 events are currently available:
1633
1634 ┌───────────┬──────────────────┬─────────────────────┐
1635 │EVENT TYPE │ NAME │ DESCRIPTION │
1636 ├───────────┼──────────────────┼─────────────────────┤
1637 │0x80000000 │ workspace │ Sent whenever an │
1638 │ │ │ event involving a │
1639 │ │ │ workspace occurs │
1640 │ │ │ such as initializa‐ │
1641 │ │ │ tion of a new │
1642 │ │ │ workspace or a dif‐ │
1643 │ │ │ ferent workspace │
1644 │ │ │ gains focus │
1645 ├───────────┼──────────────────┼─────────────────────┤
1646 │0x80000002 │ mode │ Sent whenever the │
1647 │ │ │ binding mode │
1648 │ │ │ changes │
1649 ├───────────┼──────────────────┼─────────────────────┤
1650 │0x80000003 │ window │ Sent whenever an │
1651 │ │ │ event involving a │
1652 │ │ │ view occurs such as │
1653 │ │ │ being reparented, │
1654 │ │ │ focused, or closed │
1655 ├───────────┼──────────────────┼─────────────────────┤
1656 │0x80000004 │ barconfig_update │ Sent whenever a bar │
1657 │ │ │ config changes │
1658 ├───────────┼──────────────────┼─────────────────────┤
1659 │0x80000005 │ binding │ Sent when a config‐ │
1660 │ │ │ ured binding is ex‐ │
1661 │ │ │ ecuted │
1662 ├───────────┼──────────────────┼─────────────────────┤
1663 │0x80000006 │ shutdown │ Sent when the ipc │
1664 │ │ │ shuts down because │
1665 │ │ │ sway is exiting │
1666 ├───────────┼──────────────────┼─────────────────────┤
1667 │0x80000007 │ tick │ Sent when an ipc │
1668 │ │ │ client sends a │
1669 │ │ │ SEND_TICK message │
1670 ├───────────┼──────────────────┼─────────────────────┤
1671 │0x80000014 │ bar_state_update │ Send when the visi‐ │
1672 │ │ │ bility of a bar │
1673 │ │ │ should change due │
1674 │ │ │ to a modifier │
1675 ├───────────┼──────────────────┼─────────────────────┤
1676 │0x80000015 │ input │ Sent when something │
1677 │ │ │ related to input │
1678 │ │ │ devices changes │
1679 └───────────┴──────────────────┴─────────────────────┘
1680
1681 0x80000000. WORKSPACE
1682 Sent whenever a change involving a workspace occurs. The event consists
1683 of a single object with the following properties:
1684
1685 ┌─────────┬───────────┬─────────────────────┐
1686 │PROPERTY │ DATA TYPE │ DESCRIPTION │
1687 ├─────────┼───────────┼─────────────────────┤
1688 │ change │ string │ The type of change │
1689 │ │ │ that occurred. See │
1690 │ │ │ below for more in‐ │
1691 │ │ │ formation │
1692 ├─────────┼───────────┼─────────────────────┤
1693 │current │ object │ An object repre‐ │
1694 │ │ │ senting the │
1695 │ │ │ workspace effected │
1696 │ │ │ or null for reload │
1697 │ │ │ changes │
1698 ├─────────┼───────────┼─────────────────────┤
1699 │ old │ object │ For a focus change, │
1700 │ │ │ this is will be an │
1701 │ │ │ object representing │
1702 │ │ │ the workspace being │
1703 │ │ │ switched from. Oth‐ │
1704 │ │ │ erwise, it is null │
1705 └─────────┴───────────┴─────────────────────┘
1706
1707 The following change types are currently available:
1708
1709 ┌───────┬────────────────────────────┐
1710 │ TYPE │ DESCRIPTION │
1711 ├───────┼────────────────────────────┤
1712 │ init │ The workspace was created │
1713 ├───────┼────────────────────────────┤
1714 │empty │ The workspace is empty and │
1715 │ │ is being destroyed since │
1716 │ │ it is not visible │
1717 ├───────┼────────────────────────────┤
1718 │focus │ The workspace was focused. │
1719 │ │ See the old property for │
1720 │ │ the previous focus │
1721 ├───────┼────────────────────────────┤
1722 │ move │ The workspace was moved to │
1723 │ │ a different output │
1724 ├───────┼────────────────────────────┤
1725 │rename │ The workspace was renamed │
1726 ├───────┼────────────────────────────┤
1727 │urgent │ A view on the workspace │
1728 │ │ has had their urgency hint │
1729 │ │ set or all urgency hints │
1730 │ │ for views on the workspace │
1731 │ │ have been cleared │
1732 ├───────┼────────────────────────────┤
1733 │reload │ The configuration file has │
1734 │ │ been reloaded │
1735 └───────┴────────────────────────────┘
1736
1737 Example Event:
1738 {
1739 "change": "init",
1740 "old": null,
1741 "current": {
1742 "id": 10,
1743 "name": "2",
1744 "rect": {
1745 "x": 0,
1746 "y": 0,
1747 "width": 0,
1748 "height": 0
1749 },
1750 "focused": false,
1751 "focus": [
1752 ],
1753 "border": "none",
1754 "current_border_width": 0,
1755 "layout": "splith",
1756 "percent": null,
1757 "window_rect": {
1758 "x": 0,
1759 "y": 0,
1760 "width": 0,
1761 "height": 0
1762 },
1763 "deco_rect": {
1764 "x": 0,
1765 "y": 0,
1766 "width": 0,
1767 "height": 0
1768 },
1769 "geometry": {
1770 "x": 0,
1771 "y": 0,
1772 "width": 0,
1773 "height": 0
1774 },
1775 "window": null,
1776 "urgent": false,
1777 "floating_nodes": [
1778 ],
1779 "num": 2,
1780 "output": "eDP-1",
1781 "type": "workspace",
1782 "representation": null,
1783 "nodes": [
1784 ]
1785 }
1786 }
1787
1788 0x80000002. MODE
1789 Sent whenever the binding mode changes. The event consists of a single
1790 object with the following properties:
1791
1792 ┌─────────────┬───────────┬─────────────────────┐
1793 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1794 ├─────────────┼───────────┼─────────────────────┤
1795 │ change │ string │ The binding mode │
1796 │ │ │ that became active │
1797 ├─────────────┼───────────┼─────────────────────┤
1798 │pango_markup │ boolean │ Whether the mode │
1799 │ │ │ should be parsed as │
1800 │ │ │ pango markup │
1801 └─────────────┴───────────┴─────────────────────┘
1802
1803 Example Event:
1804 {
1805 "change": "default",
1806 "pango_markup": false
1807 }
1808
1809 0x80000003. WINDOW
1810 Sent whenever a change involving a view occurs. The event consists of a
1811 single object with the following properties:
1812
1813 ┌──────────┬───────────┬────────────────────┐
1814 │PROPERTY │ DATA TYPE │ DESCRIPTION │
1815 ├──────────┼───────────┼────────────────────┤
1816 │ change │ string │ The type of change │
1817 │ │ │ that occurred. See │
1818 │ │ │ below for more in‐ │
1819 │ │ │ formation │
1820 ├──────────┼───────────┼────────────────────┤
1821 │container │ object │ An object repre‐ │
1822 │ │ │ senting the view │
1823 │ │ │ effected │
1824 └──────────┴───────────┴────────────────────┘
1825
1826 The following change types are currently available:
1827
1828 ┌────────────────┬────────────────────────────┐
1829 │ TYPE │ DESCRIPTION │
1830 ├────────────────┼────────────────────────────┤
1831 │ new │ The view was created │
1832 ├────────────────┼────────────────────────────┤
1833 │ close │ The view was closed │
1834 ├────────────────┼────────────────────────────┤
1835 │ focus │ The view was focused │
1836 ├────────────────┼────────────────────────────┤
1837 │ title │ The view's title has │
1838 │ │ changed │
1839 ├────────────────┼────────────────────────────┤
1840 │fullscreen_mode │ The view's fullscreen mode │
1841 │ │ has changed │
1842 ├────────────────┼────────────────────────────┤
1843 │ move │ The view has been repar‐ │
1844 │ │ ented in the tree │
1845 ├────────────────┼────────────────────────────┤
1846 │ floating │ The view has become float‐ │
1847 │ │ ing or is no longer float‐ │
1848 │ │ ing │
1849 ├────────────────┼────────────────────────────┤
1850 │ urgent │ The view's urgency hint │
1851 │ │ has changed status │
1852 ├────────────────┼────────────────────────────┤
1853 │ mark │ A mark has been added or │
1854 │ │ removed from the view │
1855 └────────────────┴────────────────────────────┘
1856
1857 Example Event:
1858 {
1859 "change": "new",
1860 "container": {
1861 "id": 12,
1862 "name": null,
1863 "rect": {
1864 "x": 0,
1865 "y": 0,
1866 "width": 0,
1867 "height": 0
1868 },
1869 "focused": false,
1870 "focus": [
1871 ],
1872 "border": "none",
1873 "current_border_width": 0,
1874 "layout": "none",
1875 "percent": 0.0,
1876 "window_rect": {
1877 "x": 0,
1878 "y": 0,
1879 "width": 0,
1880 "height": 0
1881 },
1882 "deco_rect": {
1883 "x": 0,
1884 "y": 0,
1885 "width": 0,
1886 "height": 0
1887 },
1888 "geometry": {
1889 "x": 0,
1890 "y": 0,
1891 "width": 1124,
1892 "height": 422
1893 },
1894 "window": 4194313,
1895 "urgent": false,
1896 "floating_nodes": [
1897 ],
1898 "type": "con",
1899 "pid": 19787,
1900 "app_id": null,
1901 "window_properties": {
1902 "class": "URxvt",
1903 "instance": "urxvt",
1904 "transient_for": null
1905 },
1906 "nodes": [
1907 ]
1908 }
1909 }
1910
1911 0x80000004. BARCONFIG_UPDATE
1912 Sent whenever a config for a bar changes. The event is identical to
1913 that of GET_BAR_CONFIG when a bar ID is given as a payload. See 6.
1914 GET_BAR_CONFIG (WITH A PAYLOAD) above for more information.
1915
1916 0x80000005. BINDING
1917 Sent whenever a binding is executed. The event is a single object with
1918 the following properties:
1919
1920 ┌─────────────────┬───────────┬─────────────────────┐
1921 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
1922 ├─────────────────┼───────────┼─────────────────────┤
1923 │ change │ string │ The change that oc‐ │
1924 │ │ │ curred for the │
1925 │ │ │ binding. Currently │
1926 │ │ │ this will only be │
1927 │ │ │ run │
1928 ├─────────────────┼───────────┼─────────────────────┤
1929 │ command │ string │ The command associ‐ │
1930 │ │ │ ated with the bind‐ │
1931 │ │ │ ing │
1932 ├─────────────────┼───────────┼─────────────────────┤
1933 │event_state_mask │ array │ An array of strings │
1934 │ │ │ that correspond to │
1935 │ │ │ each modifier key │
1936 │ │ │ for the binding │
1937 ├─────────────────┼───────────┼─────────────────────┤
1938 │ input_code │ integer │ For keyboard bind‐ │
1939 │ │ │ codes, this is the │
1940 │ │ │ key code for the │
1941 │ │ │ binding. For mouse │
1942 │ │ │ bindings, this is │
1943 │ │ │ the X11 button num‐ │
1944 │ │ │ ber, if there is an │
1945 │ │ │ equivalent. In all │
1946 │ │ │ other cases, this │
1947 │ │ │ will be 0. │
1948 ├─────────────────┼───────────┼─────────────────────┤
1949 │ symbol │ string │ For keyboard │
1950 │ │ │ bindsyms, this is │
1951 │ │ │ the bindsym for the │
1952 │ │ │ binding. Otherwise, │
1953 │ │ │ this will be null │
1954 ├─────────────────┼───────────┼─────────────────────┤
1955 │ input_type │ string │ The input type that │
1956 │ │ │ triggered the bind‐ │
1957 │ │ │ ing. This is either │
1958 │ │ │ keyboard or mouse │
1959 └─────────────────┴───────────┴─────────────────────┘
1960
1961 Example Event:
1962 {
1963 "change": "run",
1964 "binding": {
1965 "command": "workspace 2",
1966 "event_state_mask": [
1967 "Mod4"
1968 ],
1969 "input_code": 0,
1970 "symbol": "2",
1971 "input_type": "keyboard"
1972 }
1973 }
1974
1975 0x80000006. SHUTDOWN
1976 Sent whenever the IPC is shutting down. The event is a single object
1977 with the property change, which is a string containing the reason for
1978 the shutdown. Currently, the only value for change is exit, which is
1979 issued when sway is exiting.
1980
1981 Example Event:
1982 {
1983 "change": "exit"
1984 }
1985
1986 0x80000007. TICK
1987 Sent when first subscribing to tick events or by a SEND_TICK message.
1988 The event is a single object with the following properties:
1989
1990 ┌─────────┬───────────┬─────────────────────┐
1991 │PROPERTY │ DATA TYPE │ DESCRIPTION │
1992 ├─────────┼───────────┼─────────────────────┤
1993 │ first │ boolean │ Whether this event │
1994 │ │ │ was triggered by │
1995 │ │ │ subscribing to the │
1996 │ │ │ tick events │
1997 ├─────────┼───────────┼─────────────────────┤
1998 │payload │ string │ The payload given │
1999 │ │ │ with a SEND_TICK │
2000 │ │ │ message, if any. │
2001 │ │ │ Otherwise, an empty │
2002 │ │ │ string │
2003 └─────────┴───────────┴─────────────────────┘
2004
2005 Example Event:
2006 {
2007 "first": true
2008 "payload": ""
2009 }
2010
2011 0x80000014. BAR_STATE_UPDATE
2012 Sent when the visibility of a bar changes due to a modifier being
2013 pressed. The event is a single object with the following properties:
2014
2015 ┌────────────────────┬───────────┬─────────────────────┐
2016 │ PROPERTY │ DATA TYPE │ DESCRIPTION │
2017 ├────────────────────┼───────────┼─────────────────────┤
2018 │ id │ string │ The bar ID effected │
2019 ├────────────────────┼───────────┼─────────────────────┤
2020 │visible_by_modifier │ boolean │ Whether the bar │
2021 │ │ │ should be made vis‐ │
2022 │ │ │ ible due to a modi‐ │
2023 │ │ │ fier being pressed │
2024 └────────────────────┴───────────┴─────────────────────┘
2025
2026 Example Event:
2027 {
2028 "id": "bar-0",
2029 "visible_by_modifier": true
2030 }
2031
2032 0x80000015. INPUT
2033 Sent when something related to the input devices changes. The event is
2034 a single object with the following properties:
2035
2036 ┌─────────┬───────────┬─────────────────────┐
2037 │PROPERTY │ DATA TYPE │ DESCRIPTION │
2038 ├─────────┼───────────┼─────────────────────┤
2039 │ change │ string │ What has changed │
2040 ├─────────┼───────────┼─────────────────────┤
2041 │ input │ object │ An object repre‐ │
2042 │ │ │ senting the input │
2043 │ │ │ that is identical │
2044 │ │ │ the ones GET_INPUTS │
2045 │ │ │ gives │
2046 └─────────┴───────────┴─────────────────────┘
2047 The following change types are currently available:
2048
2049 ┌────────────────┬────────────────────────────┐
2050 │ TYPE │ DESCRIPTION │
2051 ├────────────────┼────────────────────────────┤
2052 │ added │ The input device became │
2053 │ │ available │
2054 ├────────────────┼────────────────────────────┤
2055 │ removed │ The input device is no │
2056 │ │ longer available │
2057 ├────────────────┼────────────────────────────┤
2058 │ xkb_keymap │ (Keyboards only) The │
2059 │ │ keymap for the keyboard │
2060 │ │ has changed │
2061 ├────────────────┼────────────────────────────┤
2062 │ xkb_layout │ (Keyboards only) The ef‐ │
2063 │ │ fective layout in the │
2064 │ │ keymap has changed │
2065 ├────────────────┼────────────────────────────┤
2066 │libinput_config │ (libinput device only) A │
2067 │ │ libinput config option for │
2068 │ │ the device changed │
2069 └────────────────┴────────────────────────────┘
2070 Example Event:
2071 {
2072 "change": "xkb_layout",
2073 "input": {
2074 "identifier": "1:1:AT_Translated_Set_2_keyboard",
2075 "name": "AT Translated Set 2 keyboard",
2076 "vendor": 1,
2077 "product": 1,
2078 "type": "keyboard",
2079 "xkb_layout_names": [
2080 "English (US)",
2081 "English (Dvorak)"
2082 ],
2083 "xkb_active_layout_index": 1,
2084 "xkb_active_layout_name": "English (Dvorak)",
2085 "libinput": {
2086 "send_events": "enabled"
2087 }
2088 }
2089 }
2090
2092 sway(1) sway(5) sway-bar(5) swaymsg(1) sway-input(5) sway-output(5)
2093
2094
2095
2096 2021-07-23 sway-ipc(7)