Skip to content

Commit

Permalink
add fallback for XDG_CACHE_HOME
Browse files Browse the repository at this point in the history
Signed-off-by: Rentib <[email protected]>
  • Loading branch information
Rentib committed Oct 27, 2024
1 parent 37dde1a commit 7716523
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/thumbnail.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ static bool get_thumb_path(char** path, const char* source)
{
const char* prefix = "XDG_CACHE_HOME";
const char* postfix = "/swayimg";
if (!(*path = expand_path(prefix, postfix)) ||
const char* prefix_fallback = "HOME";
const char* postfix_fallback = "/.cache/swayimg";
if ((!(*path = expand_path(prefix, postfix)) &&
!(*path = expand_path(prefix_fallback, postfix_fallback))) ||
!(*path = str_append(source, 0, path))) {
return false;
}
Expand Down

0 comments on commit 7716523

Please sign in to comment.