summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hofmann <scm@uninformativ.de>2014-06-19 09:49:20 +0200
committerPeter Hofmann <scm@uninformativ.de>2014-06-19 09:49:20 +0200
commit93fe780df78f1e5674e34f6b766ae8b0e878ea7e (patch)
tree822f280fc6fa643ae1ba6447ce14e03bb1bf0542
parent4c4e9b3ac42ee18178d8f784f110bef6f0716b7e (diff)
downloadlariza-93fe780df78f1e5674e34f6b766ae8b0e878ea7e.tar.gz
The FIFO filename can have a suffix
This allows for launching lariza like this: $ LARIZA_FIFO_SUFFIX=1 lariza file:///home/void/bookmarks.xhtml And another instance like this: $ LARIZA_FIFO_SUFFIX=2 lariza http://www.startpage.com
-rw-r--r--browser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/browser.c b/browser.c
index fe66eb4..1ce72c2 100644
--- a/browser.c
+++ b/browser.c
@@ -325,9 +325,17 @@ void
cooperation_setup(void)
{
GIOChannel *towatch;
+ const gchar *e;
+ gchar *fifofilename;
gchar *fifopath;
- fifopath = g_build_filename(g_get_user_runtime_dir(), __NAME__".fifo", NULL);
+ e = g_getenv(__NAME_UPPERCASE__"_FIFO_SUFFIX");
+ if (e != NULL)
+ fifofilename = g_strdup_printf("%s-%s", __NAME__".fifo", e);
+ else
+ fifofilename = g_strdup(__NAME__".fifo");
+ fifopath = g_build_filename(g_get_user_runtime_dir(), fifofilename, NULL);
+ g_free(fifofilename);
if (!g_file_test(fifopath, G_FILE_TEST_EXISTS))
mkfifo(fifopath, 0600);