From 5d896893deb02941817bb4fc93a486a2bf48a794 Mon Sep 17 00:00:00 2001 From: GoatFoo Date: Sat, 22 Jul 2023 18:28:08 +0200 Subject: [PATCH] Support symlinks (#78) --- src/Hyprpaper.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Hyprpaper.cpp b/src/Hyprpaper.cpp index 7cfd459..8923868 100644 --- a/src/Hyprpaper.cpp +++ b/src/Hyprpaper.cpp @@ -121,7 +121,13 @@ void CHyprpaper::preloadAllWallpapersFromConfig() { continue; m_mWallpaperTargets[wp] = CWallpaperTarget(); - m_mWallpaperTargets[wp].create(wp); + if (std::filesystem::is_symlink(wp)) { + auto real_wp = std::filesystem::read_symlink(wp); + m_mWallpaperTargets[wp].create(real_wp); + } else { + m_mWallpaperTargets[wp].create(wp); + } + } g_pConfigManager->m_dRequestedPreloads.clear(); @@ -597,4 +603,4 @@ void CHyprpaper::unlockSingleInstance() { const std::string XDG_RUNTIME_DIR = getenv("XDG_RUNTIME_DIR"); const auto LOCKFILE = XDG_RUNTIME_DIR + "/hyprpaper.lock"; unlink(LOCKFILE.c_str()); -} \ No newline at end of file +}