From 5e73eb60552d48d55541c60f9a8da2b666003fe6 Mon Sep 17 00:00:00 2001 From: slowsage <84777606+slowsage@users.noreply.github.com> Date: Sat, 19 Aug 2023 17:28:55 -0400 Subject: [PATCH] fix: Read absolute path of symlinks (#90) --- src/Hyprpaper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Hyprpaper.cpp b/src/Hyprpaper.cpp index 96d3300..7a9b108 100644 --- a/src/Hyprpaper.cpp +++ b/src/Hyprpaper.cpp @@ -123,7 +123,9 @@ void CHyprpaper::preloadAllWallpapersFromConfig() { m_mWallpaperTargets[wp] = CWallpaperTarget(); if (std::filesystem::is_symlink(wp)) { auto real_wp = std::filesystem::read_symlink(wp); - m_mWallpaperTargets[wp].create(real_wp); + std::filesystem::path absolute_path = std::filesystem::path(wp).parent_path() / real_wp; + absolute_path = absolute_path.lexically_normal(); + m_mWallpaperTargets[wp].create(absolute_path); } else { m_mWallpaperTargets[wp].create(wp); }