Example output for swaymsg -t get_tree:
{
"id": 1,
"type": "root",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "root",
"window": null,
"nodes": [
{
"id": 2147483647,
"type": "output",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [],
"focused": false,
"layout": "output",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "__i3",
"window": null,
"nodes": [
{
"id": 2147483646,
"type": "workspace",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "__i3_scratch",
"window": null,
"nodes": [],
"floating_nodes": [],
"focus": [],
"fullscreen_mode": 1,
"sticky": false,
"floating": null,
"scratchpad_state": null
}
],
"floating_nodes": [],
"focus": [
2147483646
],
"fullscreen_mode": 0,
"sticky": false,
"floating": null,
"scratchpad_state": null
},
{
"id": 3,
"type": "output",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [],
"focused": false,
"layout": "output",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 0,
"y": 0,
"width": 1920,
"height": 1080
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "eDP-1",
"window": null,
"nodes": [
{
"id": 6,
"type": "workspace",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 20,
"y": 55,
"width": 1880,
"height": 1005
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "1",
"window": null,
"nodes": [
{
"id": 8,
"type": "con",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [],
"focused": false,
"layout": "none",
"border": "pixel",
"current_border_width": 2,
"rect": {
"x": 20,
"y": 55,
"width": 1880,
"height": 1005
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 2,
"y": 2,
"width": 1876,
"height": 1001
},
"geometry": {
"x": 0,
"y": 0,
"width": 931,
"height": 1001
},
"name": "how to go to the other bracket in vim at DuckDuckGo — Mozilla Firefox",
"window": null,
"nodes": [],
"floating_nodes": [],
"focus": [],
"fullscreen_mode": 0,
"sticky": false,
"floating": "auto_off",
"scratchpad_state": "none",
"pid": 753,
"app_id": "firefox",
"foreign_toplevel_identifier": "460c3ad942cf37b471562bc1c6dea6d2",
"visible": false,
"max_render_time": 0,
"allow_tearing": false,
"shell": "xdg_shell",
"inhibit_idle": false,
"sandbox_engine": null,
"sandbox_app_id": null,
"sandbox_instance_id": null,
"idle_inhibitors": {
"user": "none",
"application": "none"
}
}
],
"floating_nodes": [],
"focus": [
8
],
"fullscreen_mode": 1,
"sticky": false,
"floating": null,
"scratchpad_state": null,
"num": 1,
"output": "eDP-1",
"representation": "H[firefox]"
},
{
"id": 9,
"type": "workspace",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 20,
"y": 55,
"width": 1880,
"height": 1005
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "2",
"window": null,
"nodes": [
{
"id": 10,
"type": "con",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [],
"focused": false,
"layout": "none",
"border": "pixel",
"current_border_width": 2,
"rect": {
"x": 20,
"y": 55,
"width": 1880,
"height": 1005
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 2,
"y": 2,
"width": 1876,
"height": 1001
},
"geometry": {
"x": 0,
"y": 0,
"width": 800,
"height": 600
},
"name": "erackleff@erackleff:~\/dev\/sway-screen-time\/src",
"window": null,
"nodes": [],
"floating_nodes": [],
"focus": [],
"fullscreen_mode": 0,
"sticky": false,
"floating": "auto_off",
"scratchpad_state": "none",
"pid": 1671,
"app_id": "Alacritty",
"foreign_toplevel_identifier": "2feb199f1d8d71f51b9e96326e22c8d1",
"visible": false,
"max_render_time": 0,
"allow_tearing": false,
"shell": "xdg_shell",
"inhibit_idle": false,
"sandbox_engine": null,
"sandbox_app_id": null,
"sandbox_instance_id": null,
"idle_inhibitors": {
"user": "none",
"application": "none"
}
}
],
"floating_nodes": [],
"focus": [
10
],
"fullscreen_mode": 1,
"sticky": false,
"floating": null,
"scratchpad_state": null,
"num": 2,
"output": "eDP-1",
"representation": "H[Alacritty]"
},
{
"id": 17,
"type": "workspace",
"orientation": "horizontal",
"percent": null,
"urgent": false,
"marks": [],
"focused": false,
"layout": "splith",
"border": "none",
"current_border_width": 0,
"rect": {
"x": 20,
"y": 55,
"width": 1880,
"height": 1005
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"geometry": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"name": "3",
"window": null,
"nodes": [
{
"id": 18,
"type": "con",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [],
"focused": true,
"layout": "none",
"border": "pixel",
"current_border_width": 2,
"rect": {
"x": 20,
"y": 55,
"width": 1880,
"height": 1005
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 2,
"y": 2,
"width": 1876,
"height": 1001
},
"geometry": {
"x": 0,
"y": 0,
"width": 800,
"height": 600
},
"name": "erackleff@erackleff:~\/dev\/sway-screen-time\/src",
"window": null,
"nodes": [],
"floating_nodes": [],
"focus": [],
"fullscreen_mode": 0,
"sticky": false,
"floating": "auto_off",
"scratchpad_state": "none",
"pid": 4044,
"app_id": "Alacritty",
"foreign_toplevel_identifier": "549ccc67b29dd7fb0da9f0823527edcc",
"visible": true,
"max_render_time": 0,
"allow_tearing": false,
"shell": "xdg_shell",
"inhibit_idle": false,
"sandbox_engine": null,
"sandbox_app_id": null,
"sandbox_instance_id": null,
"idle_inhibitors": {
"user": "none",
"application": "none"
}
}
],
"floating_nodes": [],
"focus": [
18
],
"fullscreen_mode": 1,
"sticky": false,
"floating": null,
"scratchpad_state": null,
"num": 3,
"output": "eDP-1",
"representation": "H[Alacritty]"
}
],
"floating_nodes": [],
"focus": [
17,
9,
6
],
"fullscreen_mode": 0,
"sticky": false,
"floating": null,
"scratchpad_state": null,
"primary": false,
"make": "LG Display",
"model": "0x05B3",
"serial": "Unknown",
"modes": [
{
"width": 1920,
"height": 1080,
"refresh": 60020,
"picture_aspect_ratio": "none"
},
{
"width": 1920,
"height": 1080,
"refresh": 48034,
"picture_aspect_ratio": "none"
}
],
"non_desktop": false,
"active": true,
"dpms": true,
"power": true,
"scale": 1.0,
"scale_filter": "nearest",
"transform": "normal",
"adaptive_sync_status": "disabled",
"current_workspace": "3",
"current_mode": {
"width": 1920,
"height": 1080,
"refresh": 48034,
"picture_aspect_ratio": "none"
},
"max_render_time": 0,
"allow_tearing": false
}
],
"floating_nodes": [],
"focus": [
3
],
"fullscreen_mode": 0,
"sticky": false,
"floating": null,
"scratchpad_state": null
}Example output for swaymsg -t subscribe -m '["window"]':
{
"change": "focus",
"container": {
"id": 10,
"type": "con",
"orientation": "none",
"percent": 1.0,
"urgent": false,
"marks": [],
"focused": true,
"layout": "none",
"border": "pixel",
"current_border_width": 2,
"rect": {
"x": 20,
"y": 55,
"width": 1880,
"height": 1005
},
"deco_rect": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"window_rect": {
"x": 2,
"y": 2,
"width": 1876,
"height": 1001
},
"geometry": {
"x": 0,
"y": 0,
"width": 800,
"height": 600
},
"name": "erackleff@erackleff:~\/dev\/sway-screen-time",
"window": null,
"nodes": [],
"floating_nodes": [],
"focus": [],
"fullscreen_mode": 0,
"sticky": false,
"floating": "auto_off",
"scratchpad_state": "none",
"pid": 1671,
"app_id": "Alacritty",
"foreign_toplevel_identifier": "2feb199f1d8d71f51b9e96326e22c8d1",
"visible": true,
"max_render_time": 0,
"allow_tearing": false,
"shell": "xdg_shell",
"inhibit_idle": false,
"sandbox_engine": null,
"sandbox_app_id": null,
"sandbox_instance_id": null,
"idle_inhibitors": {
"user": "none",
"application": "none"
}
}
}