diff options
author | Drew DeVault <[email protected]> | 2017-04-10 08:19:02 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2017-04-10 08:19:02 -0400 |
commit | cd3c48fb9d70fd49c53922b0b294828130fcaaa5 (patch) | |
tree | 35860f43beb1ce46de5a3d780ca33830d4bc9ba4 /sway/ipc-server.c | |
parent | 7fee555a462b001748352da1339c9bcc0e154a3b (diff) | |
parent | 5d3a02a7c624bbef07b1b228eb1bb60fade5248c (diff) |
Merge pull request #1146 from SirCmpwn/pretty-print-swaymsg
Add pretty printing to swaymsg
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 6554098b..67a3cdc8 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c @@ -421,17 +421,9 @@ void ipc_client_handle_command(struct ipc_client *client) { } json_object *inputs = json_object_new_array(); if (input_devices) { - for(int i=0; i<input_devices->length; i++) { + for(int i = 0; i<input_devices->length; i++) { struct libinput_device *device = input_devices->items[i]; - char* identifier = libinput_dev_unique_id(device); - json_object *device_object = json_object_new_object(); - if (!identifier) { - json_object_object_add(device_object, "identifier", NULL); - } else { - json_object_object_add(device_object, "identifier", json_object_new_string(identifier)); - } - json_object_array_add(inputs, device_object); - free(identifier); + json_object_array_add(inputs, ipc_json_describe_input(device)); } } const char *json_string = json_object_to_json_string(inputs); |