From 6d09938230f85faebe2acaf6f54496117f5dbe34 Mon Sep 17 00:00:00 2001 From: miguel Date: Fri, 16 Mar 2018 01:19:49 +0100 Subject: modal keybindings and window spawning in existing process --- piper_webext.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'piper_webext.c') diff --git a/piper_webext.c b/piper_webext.c index 172039e..3d0d3c1 100644 --- a/piper_webext.c +++ b/piper_webext.c @@ -54,13 +54,22 @@ static int piper_lock(char *path) return pipe; } -void piper_init(char *path_in,char *path_out,void (*callback_func)(char *msg)) +void piper_init(char *path_in,char *path_out,void (*callback_func)(char *msg),char *url) { pipe_in_callback=callback_func; pipe_out_fd=piper_lock(path_out); if(pipe_out_fd==-1) { - g_print("can not get exclusive lock! Bailing out.\n"); + g_print("can not get exclusive lock! Sending messsage and Bailing out.\n"); + if(url!=NULL) + { + gchar *fullpath=getpath(path_in); + int pipe=open(fullpath, O_RDWR | O_CREAT | O_TRUNC); + g_print("pipe fd: %i",pipe); + write(pipe,url,strlen(url)); + write(pipe,"\n",1); + close(pipe); + } exit(0); } register_callback(path_in); -- cgit v1.2.3