summaryrefslogtreecommitdiff
path: root/sway/commands/clipboard.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2018-04-12 20:19:54 -0400
committerDrew DeVault <[email protected]>2018-04-12 20:19:54 -0400
commitcd1b32453a9296c18b28bff71607aeb22987b5cd (patch)
treec653c6d525b471914c01a9d7ae543f521b6138ed /sway/commands/clipboard.c
parent8e06985cc1b479724446fba752e0fecfb998e87b (diff)
parent5785170421dc38437acde8bb61068cd16fda716c (diff)
Merge branch 'wlroots'
Diffstat (limited to 'sway/commands/clipboard.c')
-rw-r--r--sway/commands/clipboard.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/sway/commands/clipboard.c b/sway/commands/clipboard.c
deleted file mode 100644
index 95514e78..00000000
--- a/sway/commands/clipboard.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <wlc/wlc.h>
-#include <unistd.h>
-#include <string.h>
-#include "sway/commands.h"
-#include "stringop.h"
-
-static void send_clipboard(void *data, const char *type, int fd) {
- if (strcmp(type, "text/plain") != 0
- && strcmp(type, "text/plain;charset=utf-8") != 0) {
- close(fd);
- return;
- }
-
- const char *str = data;
- write(fd, str, strlen(str));
- close(fd);
-}
-
-struct cmd_results *cmd_clipboard(int argc, char **argv) {
- static char *current_data = NULL;
-
- struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "clipboard", EXPECTED_AT_LEAST, 1))) {
- return error;
- }
-
- static const char *types[2] = {
- "text/plain",
- "text/plain;charset=utf-8"
- };
-
- char *str = join_args(argv, argc);
- wlc_set_selection(str, types, 2, &send_clipboard);
-
- free(current_data);
- current_data = str;
- return cmd_results_new(CMD_SUCCESS, NULL, NULL);
-}