set CONFIG_DIR env variable and chdir to config dir

This commit is contained in:
Felix Kratz 2023-03-17 15:06:58 +01:00
parent d8dcf4ef76
commit 81ce6363fa

View file

@ -7,6 +7,7 @@
#include "power.h"
#include "wifi.h"
#include "misc/help.h"
#include <libgen.h>
#define LCFILE_PATH_FMT "/tmp/sketchybar_%s.lock"
@ -138,6 +139,9 @@ static void exec_config_file(void) {
return;
}
setenv("CONFIG_DIR", dirname(g_config_file), 1);
chdir(dirname(g_config_file));
if (!ensure_executable_permission(g_config_file)) {
printf("could not set the executable permission bit for '%s'", g_config_file);
return;