aboutsummaryrefslogtreecommitdiff
path: root/swaymsg/main.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-11-27 10:10:29 -0500
committerDrew DeVault <sir@cmpwn.com>2015-11-27 10:10:29 -0500
commit062c74b7d01a543c69d206a036deff75bc9f7cf1 (patch)
tree6ac5b23e1ca2b471a82c9e2978e0e9d2db1b5bc4 /swaymsg/main.c
parent59e97c27884a0dc82eb45f3269368bb684044aa2 (diff)
Add command line to swaygrab
Also modifies IPC client so that we can work with persistent connections.
Diffstat (limited to 'swaymsg/main.c')
-rw-r--r--swaymsg/main.c5
1 files changed, 4 insertions, 1 deletions
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);