2014-02-05 16:18:14 -05:00
|
|
|
Allow the configuration file and theme directory to be specified at run time.
|
2023-12-13 20:28:44 -05:00
|
|
|
|
2014-02-05 16:18:14 -05:00
|
|
|
Patch by Eelco Dolstra, from Nixpkgs.
|
2023-12-13 20:28:44 -05:00
|
|
|
---
|
|
|
|
app.cpp | 8 ++++++--
|
|
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
2014-02-05 16:18:14 -05:00
|
|
|
|
2023-12-13 20:28:44 -05:00
|
|
|
diff --git a/app.cpp b/app.cpp
|
|
|
|
index 237477d..735df9c 100644
|
|
|
|
--- a/app.cpp
|
|
|
|
+++ b/app.cpp
|
|
|
|
@@ -285,7 +285,9 @@ void App::Run()
|
|
|
|
if ( cfg == 0 )
|
|
|
|
{
|
|
|
|
cfg = new Cfg;
|
|
|
|
- cfg->readConf(CFGFILE);
|
|
|
|
+ const char* cfgfile = getenv("SLIM_CFGFILE");
|
|
|
|
+ if (!cfgfile) cfgfile = CFGFILE;
|
|
|
|
+ cfg->readConf(cfgfile);
|
|
|
|
}
|
2014-02-05 16:18:14 -05:00
|
|
|
string themebase = "";
|
|
|
|
string themefile = "";
|
2023-12-13 20:28:44 -05:00
|
|
|
@@ -297,7 +299,9 @@ void App::Run()
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-02-05 16:18:14 -05:00
|
|
|
- themebase = string(THEMESDIR) + "/";
|
2023-12-13 20:28:44 -05:00
|
|
|
+ const char* themesdir = getenv("SLIM_THEMESDIR");
|
2014-02-05 16:18:14 -05:00
|
|
|
+ if (!themesdir) themesdir = THEMESDIR;
|
|
|
|
+ themebase = string(themesdir) + "/";
|
|
|
|
themeName = cfg->getOption("current_theme");
|
|
|
|
string::size_type pos;
|
2023-12-13 20:28:44 -05:00
|
|
|
if ((pos = themeName.find(",")) != string::npos)
|
|
|
|
--
|
|
|
|
2.39.2
|
|
|
|
|