diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 51e6a995..40cc7341 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -300,6 +300,7 @@ static void ipc_json_describe_wlr_output(struct wlr_output *wlr_output, json_obj json_object_new_string(wlr_output->model ? wlr_output->model : "Unknown")); json_object_object_add(object, "serial", json_object_new_string(wlr_output->serial ? wlr_output->serial : "Unknown")); + json_object_object_add(object, "port", json_object_new_string(wlr_output->port)); json_object *modes_array = json_object_new_array(); struct wlr_output_mode *mode; diff --git a/swaymsg/main.c b/swaymsg/main.c index db9346c4..dda890a0 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -193,11 +193,12 @@ static void pretty_print_output(json_object *o) { json_object_object_get_ex(o, "power", &power); json_object_object_get_ex(o, "current_workspace", &ws); json_object_object_get_ex(o, "non_desktop", &non_desktop); - json_object *make, *model, *serial, *scale, *scale_filter, *subpixel, + json_object *make, *model, *serial, *port, *scale, *scale_filter, *subpixel, *transform, *max_render_time, *adaptive_sync_status; json_object_object_get_ex(o, "make", &make); json_object_object_get_ex(o, "model", &model); json_object_object_get_ex(o, "serial", &serial); + json_object_object_get_ex(o, "port", &port); json_object_object_get_ex(o, "scale", &scale); json_object_object_get_ex(o, "scale_filter", &scale_filter); json_object_object_get_ex(o, "subpixel_hinting", &subpixel); @@ -267,6 +268,10 @@ static void pretty_print_output(json_object *o) { ); } + if (port != NULL) { + printf(" Port: %s\n", json_object_get_string(port)); + } + size_t modes_len = json_object_is_type(modes, json_type_array) ? json_object_array_length(modes) : 0; if (modes_len > 0) {