From 87a6144e1944350eb70685578b5954deb60608ee Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 6 Nov 2019 21:14:35 -0500 Subject: [PATCH] added command to pass primary selection to the fetch command --- src/fetchsel.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/fetchsel.c diff --git a/src/fetchsel.c b/src/fetchsel.c new file mode 100644 index 0000000..de6ab68 --- /dev/null +++ b/src/fetchsel.c @@ -0,0 +1,19 @@ +#include +#include + +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; +} -- 2.52.0