diff --git a/include/zx.h b/include/zx.h index 7c8f886..48c769f 100644 --- a/include/zx.h +++ b/include/zx.h @@ -43,6 +43,7 @@ typedef struct zx { char *homedir; int daemon; char *font; + char *conf_path; int pin_bottom; char **floating_windows; unsigned long floating_windows_length; diff --git a/src/zx.c b/src/zx.c index 34242ce..1378317 100644 --- a/src/zx.c +++ b/src/zx.c @@ -104,7 +104,11 @@ void zx_config(xcb_helper_struct *_s, zx *zs) { char **flwin_list = NULL; char config_path[255]; - sprintf(config_path, "%s/.zxconfig", zs->homedir); + if (zs->conf_path) { + sprintf(config_path, "%s", zs->conf_path); + } else { + sprintf(config_path, "%s/.zxconfig", zs->homedir); + } GKeyFile* gkf = g_key_file_new(); @@ -494,9 +498,12 @@ int main(int argc, char **argv) { zx_log_init(zs); + int ch; + if ((ch = getopt(argc, argv, "c:")) != 1) { + zs->conf_path = optarg; + } zx_config(_s, zs); - int ch; while ((ch = getopt(argc, argv, "hx:y:H:d:b:f:n:F:a:B:p:t:")) != -1) { switch(ch) { case 'h':