From 062c74b7d01a543c69d206a036deff75bc9f7cf1 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 27 Nov 2015 10:10:29 -0500 Subject: Add command line to swaygrab Also modifies IPC client so that we can work with persistent connections. --- swaymsg/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'swaymsg/main.c') diff --git a/swaymsg/main.c b/swaymsg/main.c index 8d20905a..3a2e1ee7 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -93,10 +93,13 @@ int main(int argc, char **argv) { command = join_args(argv + optind, argc - optind); } - char *resp = ipc_single_command(socket_path, type, command, strlen(command)); + int socketfd = ipc_open_socket(socket_path); + uint32_t len = strlen(command); + char *resp = ipc_single_command(socketfd, type, command, &len); if (!quiet) { printf("%s", resp); } + close(socketfd); free(command); free(resp); -- cgit v1.2.3