mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-09-11 19:07:40 +03:00
Merge pull request #16 from pinnouse/main
Allow parsing home dir with contains keyword
This commit is contained in:
commit
707ae57d44
@ -122,16 +122,16 @@ void CConfigManager::handleWallpaper(const std::string& COMMAND, const std::stri
|
||||
|
||||
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) {
|
||||
WALLPAPER = WALLPAPER.substr(8);
|
||||
contain = true;
|
||||
}
|
||||
|
||||
if (WALLPAPER[0] == '~') {
|
||||
static const char* const ENVHOME = getenv("HOME");
|
||||
WALLPAPER = std::string(ENVHOME) + WALLPAPER.substr(1);
|
||||
}
|
||||
|
||||
if (!std::filesystem::exists(WALLPAPER)) {
|
||||
parseError = "wallpaper failed (no such file)";
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user