aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2020-04-25 15:10:22 -0400
committerFurkan Sahin <furkan-dev@proton.me>2020-04-25 15:10:22 -0400
commit4a04bcf119f7a4c78d507077e49ed8c12f5e7aa0 (patch)
treee073a8682121a1f225bfa2ab4059d85620a82bff
parent86f8743f924397a84af3ea9d4e71acdccd4726a2 (diff)
Add each view's shell to JSON description
This is a criteria you can use to select windows since commit b8746f8727a4 ("Add shell criteria token"), but there's no way to query it for an existing window. This exposes its value in the output of `swaymsg -t get_tree`.
-rw-r--r--sway/ipc-json.c2
-rw-r--r--sway/sway-ipc.7.scd5
2 files changed, 7 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 1ebc3bd2..46c52156 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -493,6 +493,8 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object
json_object_object_add(object, "max_render_time", json_object_new_int(c->view->max_render_time));
+ json_object_object_add(object, "shell", json_object_new_string(view_get_shell(c->view)));
+
#if HAVE_XWAYLAND
if (c->view->type == SWAY_VIEW_XWAYLAND) {
json_object_object_add(object, "window",
diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd
index ab61f864..5cef0bb4 100644
--- a/sway/sway-ipc.7.scd
+++ b/sway/sway-ipc.7.scd
@@ -376,6 +376,9 @@ node and will have the following properties:
|- visible
: boolean
: (Only views) Whether the node is visible
+|- shell
+: string
+: (Only views) The shell of the view, such as _xdg\_shell_ or _xwayland_
|- window
: integer
: (Only xwayland views) The X11 window ID for the xwayland view
@@ -672,6 +675,7 @@ node and will have the following properties:
"pid": 23959,
"app_id": null,
"visible": true,
+ "shell": "xwayland",
"window_properties": {
"class": "URxvt",
"instance": "urxvt",
@@ -726,6 +730,7 @@ node and will have the following properties:
"pid": 25370,
"app_id": "termite",
"visible": true,
+ "shell": "xdg_shell",
"nodes": [
]
}