diff options
author | Alex Maese <memaese@hotmail.com> | 2022-06-09 19:17:14 -0500 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-09-19 07:26:45 -0400 |
commit | cffb006feba52c318e66f73c3463032fa76782dc (patch) | |
tree | bfcc9e01653f6d1938f5fb37122589d52aec45e3 /swaymsg | |
parent | 52f0e3a4d5bc5900df821b82a2c6941f57eaca25 (diff) |
swaymsg: show non-desktop property when pretty printing outputs
Diffstat (limited to 'swaymsg')
-rw-r--r-- | swaymsg/main.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c index c08406e2..c4e2b0bf 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -185,12 +185,13 @@ static void pretty_print_seat(json_object *i) { } static void pretty_print_output(json_object *o) { - json_object *name, *rect, *focused, *active, *ws, *current_mode; + json_object *name, *rect, *focused, *active, *ws, *current_mode, *non_desktop; json_object_object_get_ex(o, "name", &name); json_object_object_get_ex(o, "rect", &rect); json_object_object_get_ex(o, "focused", &focused); json_object_object_get_ex(o, "active", &active); 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, *transform, *max_render_time, *adaptive_sync_status; json_object_object_get_ex(o, "make", &make); @@ -213,7 +214,15 @@ static void pretty_print_output(json_object *o) { json_object_object_get_ex(current_mode, "height", &height); json_object_object_get_ex(current_mode, "refresh", &refresh); - if (json_object_get_boolean(active)) { + if (json_object_get_boolean(non_desktop)) { + printf( + "Output %s '%s %s %s' (non-desktop)\n", + json_object_get_string(name), + json_object_get_string(make), + json_object_get_string(model), + json_object_get_string(serial) + ); + } else if (json_object_get_boolean(active)) { printf( "Output %s '%s %s %s'%s\n" " Current mode: %dx%d @ %.3f Hz\n" |