diff options
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) { | |||
185 | } | 185 | } |
186 | 186 | ||
187 | static void pretty_print_output(json_object *o) { | 187 | static void pretty_print_output(json_object *o) { |
188 | json_object *name, *rect, *focused, *active, *ws, *current_mode; | 188 | json_object *name, *rect, *focused, *active, *ws, *current_mode, *non_desktop; |
189 | json_object_object_get_ex(o, "name", &name); | 189 | json_object_object_get_ex(o, "name", &name); |
190 | json_object_object_get_ex(o, "rect", &rect); | 190 | json_object_object_get_ex(o, "rect", &rect); |
191 | json_object_object_get_ex(o, "focused", &focused); | 191 | json_object_object_get_ex(o, "focused", &focused); |
192 | json_object_object_get_ex(o, "active", &active); | 192 | json_object_object_get_ex(o, "active", &active); |
193 | json_object_object_get_ex(o, "current_workspace", &ws); | 193 | json_object_object_get_ex(o, "current_workspace", &ws); |
194 | json_object_object_get_ex(o, "non_desktop", &non_desktop); | ||
194 | json_object *make, *model, *serial, *scale, *scale_filter, *subpixel, | 195 | json_object *make, *model, *serial, *scale, *scale_filter, *subpixel, |
195 | *transform, *max_render_time, *adaptive_sync_status; | 196 | *transform, *max_render_time, *adaptive_sync_status; |
196 | json_object_object_get_ex(o, "make", &make); | 197 | json_object_object_get_ex(o, "make", &make); |
@@ -213,7 +214,15 @@ static void pretty_print_output(json_object *o) { | |||
213 | json_object_object_get_ex(current_mode, "height", &height); | 214 | json_object_object_get_ex(current_mode, "height", &height); |
214 | json_object_object_get_ex(current_mode, "refresh", &refresh); | 215 | json_object_object_get_ex(current_mode, "refresh", &refresh); |
215 | 216 | ||
216 | if (json_object_get_boolean(active)) { | 217 | if (json_object_get_boolean(non_desktop)) { |
218 | printf( | ||
219 | "Output %s '%s %s %s' (non-desktop)\n", | ||
220 | json_object_get_string(name), | ||
221 | json_object_get_string(make), | ||
222 | json_object_get_string(model), | ||
223 | json_object_get_string(serial) | ||
224 | ); | ||
225 | } else if (json_object_get_boolean(active)) { | ||
217 | printf( | 226 | printf( |
218 | "Output %s '%s %s %s'%s\n" | 227 | "Output %s '%s %s %s'%s\n" |
219 | " Current mode: %dx%d @ %.3f Hz\n" | 228 | " Current mode: %dx%d @ %.3f Hz\n" |