aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2023-02-02 09:34:03 +0100
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2023-02-02 12:00:06 -0500
commitf22d4dbab721f36ba991055d87ab015d564604bb (patch)
treebcfff63188dcc2b8616d038b91d4bb909755eaf4
parentAdd Norwegian READMR (diff)
downloadsway-f22d4dbab721f36ba991055d87ab015d564604bb.tar.gz
sway-f22d4dbab721f36ba991055d87ab015d564604bb.tar.zst
sway-f22d4dbab721f36ba991055d87ab015d564604bb.zip
swaymsg: print output power status
-rw-r--r--swaymsg/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index c0b5809e..4f6fa7b1 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -185,11 +185,12 @@ static void pretty_print_seat(json_object *i) {
185} 185}
186 186
187static void pretty_print_output(json_object *o) { 187static void pretty_print_output(json_object *o) {
188 json_object *name, *rect, *focused, *active, *ws, *current_mode, *non_desktop; 188 json_object *name, *rect, *focused, *active, *power, *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, "power", &power);
193 json_object_object_get_ex(o, "current_workspace", &ws); 194 json_object_object_get_ex(o, "current_workspace", &ws);
194 json_object_object_get_ex(o, "non_desktop", &non_desktop); 195 json_object_object_get_ex(o, "non_desktop", &non_desktop);
195 json_object *make, *model, *serial, *scale, *scale_filter, *subpixel, 196 json_object *make, *model, *serial, *scale, *scale_filter, *subpixel,
@@ -226,6 +227,7 @@ static void pretty_print_output(json_object *o) {
226 printf( 227 printf(
227 "Output %s '%s %s %s'%s\n" 228 "Output %s '%s %s %s'%s\n"
228 " Current mode: %dx%d @ %.3f Hz\n" 229 " Current mode: %dx%d @ %.3f Hz\n"
230 " Power: %s\n"
229 " Position: %d,%d\n" 231 " Position: %d,%d\n"
230 " Scale factor: %f\n" 232 " Scale factor: %f\n"
231 " Scale filter: %s\n" 233 " Scale filter: %s\n"
@@ -240,6 +242,7 @@ static void pretty_print_output(json_object *o) {
240 json_object_get_int(width), 242 json_object_get_int(width),
241 json_object_get_int(height), 243 json_object_get_int(height),
242 (double)json_object_get_int(refresh) / 1000, 244 (double)json_object_get_int(refresh) / 1000,
245 json_object_get_boolean(power) ? "on" : "off",
243 json_object_get_int(x), json_object_get_int(y), 246 json_object_get_int(x), json_object_get_int(y),
244 json_object_get_double(scale), 247 json_object_get_double(scale),
245 json_object_get_string(scale_filter), 248 json_object_get_string(scale_filter),