Add support for reading the config path from env

This commit adds support to reading the config base path from the
environment variable `WAYBAR_CONFIG_DIR`. If it is set, but no
configuration is found there, it falls back to the previous mechanism
of using the default paths, without erroring.
This commit is contained in:
Blallo
2022-06-25 12:16:40 +02:00
parent 4deb6d812d
commit eb017347b8
2 changed files with 29 additions and 5 deletions

View File

@ -14,6 +14,7 @@ namespace waybar {
class Config {
public:
static const std::vector<std::string> CONFIG_DIRS;
static const char *CONFIG_PATH_ENV;
/* Try to find any of provided names in the supported set of config directories */
static std::optional<std::string> findConfigPath(