diff --git a/README.md b/README.md index 5359788..9c0a71e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ wallpaper = monitor,/path/to/image.png # .. more monitors ``` -Preload will tell Hyprland to load a particular image (supported formats: png, jpg, jpeg). Wallpaper will apply the wallpaper to the selected output (`monitor` is the monitor's name, easily can be retrieved with `hyprctl monitors`) +Preload will tell Hyprland to load a particular image (supported formats: png, jpg, jpeg). Wallpaper will apply the wallpaper to the selected output (`monitor` is the monitor's name, easily can be retrieved with `hyprctl monitors`. You can leave it empty for a wildcard (aka fallback)) You may add `contain:` before the file path in `wallpaper=` to set the mode to contain instead of cover: diff --git a/src/Hyprpaper.cpp b/src/Hyprpaper.cpp index 7fa3c9e..a610b35 100644 --- a/src/Hyprpaper.cpp +++ b/src/Hyprpaper.cpp @@ -261,6 +261,21 @@ void CHyprpaper::ensureMonitorHasActiveWallpaper(SMonitor* pMonitor) { } } + if (!it->second) { + // try to find a wildcard + for (auto&[mon, path1] : m_mMonitorActiveWallpapers) { + if (mon.empty()) { + for (auto&[path2, target] : m_mWallpaperTargets) { + if (path1 == path2) { + it->second = ⌖ + break; + } + } + break; + } + } + } + if (!it->second) { pMonitor->hasATarget = false; Debug::log(WARN, "Monitor %s does not have a target! A wallpaper will not be created.", pMonitor->name.c_str());