diff options
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/app.cpp b/src/app.cpp index c7b0391..8ff0c17 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -160,17 +160,26 @@ App::App(wl::display *d) display{d}, controller{}, outputs(), - config(), layers(), id_alloc{}, - pending_events(false), - policy{} + pending_events(false) { + char const *path_layers_json = getenv("AFM_APP_INSTALL_DIR"); + std::string path; + if (!path_layers_json) + { + HMI_ERROR("wm", "AFM_APP_INSTALL_DIR is not defined"); + path = std::string(path_layers_json); + } + else + { + path = std::string(path_layers_json) + std::string("/etc/layers.json"); + } + try { { - auto l = load_layer_map( - this->config.get_string("layers.json").value().c_str()); + auto l = load_layer_map(path.c_str()); if (l.is_ok()) { this->layers = l.unwrap(); |