summaryrefslogtreecommitdiffstats
path: root/swaymsg
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-11-27 10:10:29 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-11-27 10:10:29 -0500
commit062c74b7d01a543c69d206a036deff75bc9f7cf1 (patch)
tree6ac5b23e1ca2b471a82c9e2978e0e9d2db1b5bc4 /swaymsg
parentAdd swaygrab(1) man page (diff)
downloadsway-062c74b7d01a543c69d206a036deff75bc9f7cf1.tar.gz
sway-062c74b7d01a543c69d206a036deff75bc9f7cf1.tar.zst
sway-062c74b7d01a543c69d206a036deff75bc9f7cf1.zip
Add command line to swaygrab
Also modifies IPC client so that we can work with persistent connections.
Diffstat (limited to 'swaymsg')
-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) {
93 command = join_args(argv + optind, argc - optind); 93 command = join_args(argv + optind, argc - optind);
94 } 94 }
95 95
96 char *resp = ipc_single_command(socket_path, type, command, strlen(command)); 96 int socketfd = ipc_open_socket(socket_path);
97 uint32_t len = strlen(command);
98 char *resp = ipc_single_command(socketfd, type, command, &len);
97 if (!quiet) { 99 if (!quiet) {
98 printf("%s", resp); 100 printf("%s", resp);
99 } 101 }
102 close(socketfd);
100 103
101 free(command); 104 free(command);
102 free(resp); 105 free(resp);