]> git.mdlowis.com Git - projs/tide.git/commitdiff
added command to pass primary selection to the fetch command
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 7 Nov 2019 02:14:35 +0000 (21:14 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 7 Nov 2019 02:14:35 +0000 (21:14 -0500)
src/fetchsel.c [new file with mode: 0644]

diff --git a/src/fetchsel.c b/src/fetchsel.c
new file mode 100644 (file)
index 0000000..de6ab68
--- /dev/null
@@ -0,0 +1,19 @@
+#include <stdc.h>
+#include <x11.h>
+
+static void fetchsel(char* sel)
+{
+    execvp("fetch", (char*[]){ "fetch", sel, 0 });
+}
+
+int main(int argc, char** argv)
+{
+    (void)argc, (void)argv;
+    XConf x = {0};
+    x11_init(&x);
+    x11_mkwin(&x, 1, 1, PropertyChangeMask);
+    x11_sel_init(&x);
+    (void)x11_sel_get(&x, PRIMARY, fetchsel);
+    x11_event_loop(&x, 0);
+    return 1;
+}