From 1dbbced25cb7d44cf55393053a65e2d78d4b3822 Mon Sep 17 00:00:00 2001 From: speedie Date: Tue, 8 Aug 2023 21:01:25 +0200 Subject: [PATCH] Add configurable fifo option to config --- docs/spmenu.conf | 1 + libs/conf/config.c | 4 ++++ libs/options.h | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/spmenu.conf b/docs/spmenu.conf index e352c41..c98b116 100644 --- a/docs/spmenu.conf +++ b/docs/spmenu.conf @@ -283,6 +283,7 @@ spmenu = { xresources = 1; // Load .Xresources on startup (0/1) theme = 1; // Load theme (~/.config/spmenu/theme.conf) on runtime binds = 1; // Load binds (~/.config/spmenu/binds.conf) on runtime + fifofile = "/tmp/spmenu.fifo" // Path to the spmenu FIFO themefile = "NULL"; // Path to theme file to load on runtime. NULL means default. bindsfile = "NULL"; // Path to binds file to load on runtime. NULL means default. screenshotfile = "NULL"; // Screenshot file path. NULL means default. diff --git a/libs/conf/config.c b/libs/conf/config.c index c65ee06..47a1dc9 100644 --- a/libs/conf/config.c +++ b/libs/conf/config.c @@ -684,6 +684,10 @@ void conf_init(void) { bindsfile = strdup(dest); } + if (config_setting_lookup_string(conf, "fifofile", &dest)) { + fifofile = strdup(dest); + } + if (config_setting_lookup_string(conf, "screenshotfile", &dest) && strcmp(dest, "NULL")) { screenshotfile = strdup(dest); } diff --git a/libs/options.h b/libs/options.h index d95f839..5dd7e46 100644 --- a/libs/options.h +++ b/libs/options.h @@ -60,7 +60,7 @@ static int generatecache = 1; /* Generate image cache by default * static int maxcache = 512; /* Max image size to cache */ static char *cachedir = "default"; /* Cache directory. Default means spmenu will determine automatically */ -/* Fifo options */ +/* FIFO options */ static char *fifofile = "/tmp/spmenu.fifo"; /* spmenu FIFO path */ /* Screenshot options */