Allow parsing home dir with contains keyword

This commit is contained in:
Nick 2022-11-01 15:40:50 -04:00
parent 6fa4ea8a68
commit 77137cf72b
1 changed files with 5 additions and 5 deletions

View File

@ -122,16 +122,16 @@ void CConfigManager::handleWallpaper(const std::string& COMMAND, const std::stri
bool contain = false; bool contain = false;
if (WALLPAPER[0] == '~') {
static const char* const ENVHOME = getenv("HOME");
WALLPAPER = std::string(ENVHOME) + WALLPAPER.substr(1);
}
if (WALLPAPER.find("contain:") == 0) { if (WALLPAPER.find("contain:") == 0) {
WALLPAPER = WALLPAPER.substr(8); WALLPAPER = WALLPAPER.substr(8);
contain = true; contain = true;
} }
if (WALLPAPER[0] == '~') {
static const char* const ENVHOME = getenv("HOME");
WALLPAPER = std::string(ENVHOME) + WALLPAPER.substr(1);
}
if (!std::filesystem::exists(WALLPAPER)) { if (!std::filesystem::exists(WALLPAPER)) {
parseError = "wallpaper failed (no such file)"; parseError = "wallpaper failed (no such file)";
return; return;