diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-06-05 17:56:32 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-06-06 20:11:24 -0400 |
commit | a1b5b93d299bfe129f2b3409a7f642049fcce1d6 (patch) | |
tree | 4d87f5ab8f0f18ada1fc12a4eb4ba3b5d0350527 /swaymsg/main.c | |
parent | Merge pull request #2116 from RedSoxFan/fix-2113 (diff) | |
download | sway-a1b5b93d299bfe129f2b3409a7f642049fcce1d6.tar.gz sway-a1b5b93d299bfe129f2b3409a7f642049fcce1d6.tar.zst sway-a1b5b93d299bfe129f2b3409a7f642049fcce1d6.zip |
Store sway_outputs so that they can be reenabled
Diffstat (limited to 'swaymsg/main.c')
-rw-r--r-- | swaymsg/main.c | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c index 8a53474b..29f2a907 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c | |||
@@ -174,26 +174,35 @@ static void pretty_print_output(json_object *o) { | |||
174 | json_object *modes; | 174 | json_object *modes; |
175 | json_object_object_get_ex(o, "modes", &modes); | 175 | json_object_object_get_ex(o, "modes", &modes); |
176 | 176 | ||
177 | printf( | 177 | if (json_object_get_boolean(active)) { |
178 | "Output %s '%s %s %s'%s%s\n" | 178 | printf( |
179 | " Current mode: %dx%d @ %f Hz\n" | 179 | "Output %s '%s %s %s'%s\n" |
180 | " Position: %d,%d\n" | 180 | " Current mode: %dx%d @ %f Hz\n" |
181 | " Scale factor: %dx\n" | 181 | " Position: %d,%d\n" |
182 | " Transform: %s\n" | 182 | " Scale factor: %dx\n" |
183 | " Workspace: %s\n", | 183 | " Transform: %s\n" |
184 | json_object_get_string(name), | 184 | " Workspace: %s\n", |
185 | json_object_get_string(make), | 185 | json_object_get_string(name), |
186 | json_object_get_string(model), | 186 | json_object_get_string(make), |
187 | json_object_get_string(serial), | 187 | json_object_get_string(model), |
188 | json_object_get_boolean(focused) ? " (focused)" : "", | 188 | json_object_get_string(serial), |
189 | !json_object_get_boolean(active) ? " (inactive)" : "", | 189 | json_object_get_boolean(focused) ? " (focused)" : "", |
190 | json_object_get_int(width), json_object_get_int(height), | 190 | json_object_get_int(width), json_object_get_int(height), |
191 | (float)json_object_get_int(refresh) / 1000, | 191 | (float)json_object_get_int(refresh) / 1000, |
192 | json_object_get_int(x), json_object_get_int(y), | 192 | json_object_get_int(x), json_object_get_int(y), |
193 | json_object_get_int(scale), | 193 | json_object_get_int(scale), |
194 | json_object_get_string(transform), | 194 | json_object_get_string(transform), |
195 | json_object_get_string(ws) | 195 | json_object_get_string(ws) |
196 | ); | 196 | ); |
197 | } else { | ||
198 | printf( | ||
199 | "Output %s '%s %s %s' (inactive)", | ||
200 | json_object_get_string(name), | ||
201 | json_object_get_string(make), | ||
202 | json_object_get_string(model), | ||
203 | json_object_get_string(serial) | ||
204 | ); | ||
205 | } | ||
197 | 206 | ||
198 | size_t modes_len = json_object_array_length(modes); | 207 | size_t modes_len = json_object_array_length(modes); |
199 | if (modes_len > 0) { | 208 | if (modes_len > 0) { |