From: Michael D. Lowis Date: Thu, 7 Nov 2019 02:14:35 +0000 (-0500) Subject: added command to pass primary selection to the fetch command X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=87a6144e1944350eb70685578b5954deb60608ee;p=projs%2Ftide.git added command to pass primary selection to the fetch command --- 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; +}