Skip to content

Commit

Permalink
Support symlinks (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypikay authored Jul 22, 2023
1 parent ac5f7b0 commit 5d89689
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Hyprpaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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());
}
}

0 comments on commit 5d89689

Please sign in to comment.