From cc6d4bad93d17603ab7efe5f430ec4ad62479ff6 Mon Sep 17 00:00:00 2001 From: Erik Reider Date: Sat, 22 Apr 2023 13:31:13 +0200 Subject: [PATCH] Added "effects" array to swayipc output --- sway/ipc-json.c | 15 +++++++++++++++ sway/sway-ipc.7.scd | 13 ++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 443b7f13..9491e68b 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -373,6 +373,21 @@ static void ipc_json_describe_enabled_output(struct sway_output *output, json_object_new_int(lsurface->extent.y)); json_object_object_add(layer, "extent", extent); + json_object *effects = json_object_new_array(); + struct layer_effects *layer_effects = lsurface->effects; + if (layer_effects) { + if (layer_effects->blur) { + json_object_array_add(effects, json_object_new_string("blur")); + } + if (layer_effects->shadow) { + json_object_array_add(effects, json_object_new_string("shadow")); + } + if (layer_effects->corner_rounding) { + json_object_array_add(effects, json_object_new_string("corner_rounding")); + } + } + json_object_object_add(layer, "effects", effects); + json_object_array_add(layers, layer); } } diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd index 6e083114..2607c15c 100644 --- a/sway/sway-ipc.7.scd +++ b/sway/sway-ipc.7.scd @@ -233,7 +233,7 @@ following properties: |- layer_shell_surfaces : array : An array of all layer-shell surfaces attached to the output. Each object - contains _namespace_, _layer_, and _extent_ object that contains _x_, _y_ + contains _namespace_, _layer_, _effects_, and _extent_ object that contains _x_, _y_ _width_, and _height_ |- current_workspace : string @@ -273,7 +273,9 @@ following properties: "height": 1440, "x": 0, "y": 0 - } + }, + "effects": [ + ] }, { "namespace": "waybar", @@ -283,7 +285,12 @@ following properties: "height": 31, "x": 6, "y": 6 - } + }, + "effects": [ + "blur", + "shadow", + "corner_rounding" + ] } ], "current_workspace": "1",