| 1 | Allow the configuration file and theme directory to be specified at run time.
|
| 2 |
|
| 3 | Patch by Eelco Dolstra, from Nixpkgs.
|
| 4 | ---
|
| 5 | app.cpp | 8 ++++++--
|
| 6 | 1 file changed, 6 insertions(+), 2 deletions(-)
|
| 7 |
|
| 8 | diff --git a/app.cpp b/app.cpp
|
| 9 | index 237477d..735df9c 100644
|
| 10 | |
| 11 | |
| 12 | @@ -285,7 +285,9 @@ void App::Run()
|
| 13 | if ( cfg == 0 )
|
| 14 | {
|
| 15 | cfg = new Cfg;
|
| 16 | - cfg->readConf(CFGFILE);
|
| 17 | + const char* cfgfile = getenv("SLIM_CFGFILE");
|
| 18 | + if (!cfgfile) cfgfile = CFGFILE;
|
| 19 | + cfg->readConf(cfgfile);
|
| 20 | }
|
| 21 | string themebase = "";
|
| 22 | string themefile = "";
|
| 23 | @@ -297,7 +299,9 @@ void App::Run()
|
| 24 | }
|
| 25 | else
|
| 26 | {
|
| 27 | - themebase = string(THEMESDIR) + "/";
|
| 28 | + const char* themesdir = getenv("SLIM_THEMESDIR");
|
| 29 | + if (!themesdir) themesdir = THEMESDIR;
|
| 30 | + themebase = string(themesdir) + "/";
|
| 31 | themeName = cfg->getOption("current_theme");
|
| 32 | string::size_type pos;
|
| 33 | if ((pos = themeName.find(",")) != string::npos)
|
| 34 | --
|
| 35 | 2.39.2
|
| 36 |
|