From dfb6664906a2e01a90aa2208de8d94570e662fe7 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Thu, 18 Jan 2024 19:45:49 +0000 Subject: [PATCH] Honour -c on --reconfigure --- include/config/rcxml.h | 2 ++ src/main.c | 5 ++--- src/server.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/config/rcxml.h b/include/config/rcxml.h index fa410116..48600d50 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -47,7 +47,9 @@ struct window_switcher_field { }; struct rcxml { + /* from command line */ char *config_dir; + char *config_file; bool merge_config; /* core */ diff --git a/src/main.c b/src/main.c index 6ccf227b..9bfe3a1d 100644 --- a/src/main.c +++ b/src/main.c @@ -87,7 +87,6 @@ main(int argc, char *argv[]) textdomain(GETTEXT_PACKAGE); #endif char *startup_cmd = NULL; - char *config_file = NULL; enum wlr_log_importance verbosity = WLR_ERROR; int c; @@ -99,7 +98,7 @@ main(int argc, char *argv[]) } switch (c) { case 'c': - config_file = optarg; + rc.config_file = optarg; break; case 'C': rc.config_dir = optarg; @@ -139,7 +138,7 @@ main(int argc, char *argv[]) die_on_detecting_suid(); session_environment_init(); - rcxml_read(config_file); + rcxml_read(rc.config_file); /* * Set environment variable LABWC_PID to the pid of the compositor diff --git a/src/server.c b/src/server.c index 7e78265b..cd3b6202 100644 --- a/src/server.c +++ b/src/server.c @@ -47,7 +47,7 @@ static void reload_config_and_theme(void) { rcxml_finish(); - rcxml_read(NULL); + rcxml_read(rc.config_file); theme_finish(g_server->theme); theme_init(g_server->theme, rc.theme_name); -- 2.52.0