Add configurable fifo option to config

This commit is contained in:
Jacob 2023-08-08 21:01:25 +02:00
parent b4286559a1
commit 1dbbced25c
3 changed files with 6 additions and 1 deletions

View file

@ -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.

View file

@ -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);
}

View file

@ -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 */