aboutsummaryrefslogtreecommitdiffstats
path: root/swaymsg
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-29 17:42:11 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-29 17:42:11 +1000
commit6f4cb2b29d5a708d58a88c40ed6cc01bf471a8f0 (patch)
tree5aa498b0d4ec3a215a3ea70f082e6ab1d9f361f2 /swaymsg
parentMerge pull request #2068 from RedSoxFan/workspace-layout (diff)
downloadsway-6f4cb2b29d5a708d58a88c40ed6cc01bf471a8f0.tar.gz
sway-6f4cb2b29d5a708d58a88c40ed6cc01bf471a8f0.tar.zst
sway-6f4cb2b29d5a708d58a88c40ed6cc01bf471a8f0.zip
Add tree representation to IPC workspace description
Diffstat (limited to 'swaymsg')
-rw-r--r--swaymsg/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index bf56b80d..8a53474b 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -53,24 +53,28 @@ static void pretty_print_cmd(json_object *r) {
53} 53}
54 54
55static void pretty_print_workspace(json_object *w) { 55static void pretty_print_workspace(json_object *w) {
56 json_object *name, *rect, *visible, *output, *urgent, *layout, *focused; 56 json_object *name, *rect, *visible, *output, *urgent, *layout,
57 *representation, *focused;
57 json_object_object_get_ex(w, "name", &name); 58 json_object_object_get_ex(w, "name", &name);
58 json_object_object_get_ex(w, "rect", &rect); 59 json_object_object_get_ex(w, "rect", &rect);
59 json_object_object_get_ex(w, "visible", &visible); 60 json_object_object_get_ex(w, "visible", &visible);
60 json_object_object_get_ex(w, "output", &output); 61 json_object_object_get_ex(w, "output", &output);
61 json_object_object_get_ex(w, "urgent", &urgent); 62 json_object_object_get_ex(w, "urgent", &urgent);
62 json_object_object_get_ex(w, "layout", &layout); 63 json_object_object_get_ex(w, "layout", &layout);
64 json_object_object_get_ex(w, "representation", &representation);
63 json_object_object_get_ex(w, "focused", &focused); 65 json_object_object_get_ex(w, "focused", &focused);
64 printf( 66 printf(
65 "Workspace %s%s%s%s\n" 67 "Workspace %s%s%s%s\n"
66 " Output: %s\n" 68 " Output: %s\n"
67 " Layout: %s\n\n", 69 " Layout: %s\n"
70 " Representation: %s\n\n",
68 json_object_get_string(name), 71 json_object_get_string(name),
69 json_object_get_boolean(focused) ? " (focused)" : "", 72 json_object_get_boolean(focused) ? " (focused)" : "",
70 !json_object_get_boolean(visible) ? " (off-screen)" : "", 73 !json_object_get_boolean(visible) ? " (off-screen)" : "",
71 json_object_get_boolean(urgent) ? " (urgent)" : "", 74 json_object_get_boolean(urgent) ? " (urgent)" : "",
72 json_object_get_string(output), 75 json_object_get_string(output),
73 json_object_get_string(layout) 76 json_object_get_string(layout),
77 json_object_get_string(representation)
74 ); 78 );
75} 79}
76 80