Skip to content

Commit 9af03b2

Browse files
committed
Quick fix for paths
1 parent 2751309 commit 9af03b2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

โ€Žsrc/cb/src/utils/utils.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,15 @@ void setFilepaths() {
495495
: fs::temp_directory_path())
496496
/ constants.temporary_directory_name;
497497

498-
global_path.persistent =
499-
(getenv("CLIPBOARD_PERSISTDIR") ? getenv("CLIPBOARD_PERSISTDIR") : (getenv("XDG_STATE_HOME") ? getenv("XDG_STATE_HOME") : global_path.home)) / constants.persistent_directory_name;
498+
if (getenv("CLIPBOARD_PERSISTDIR")) {
499+
global_path.persistent = getenv("CLIPBOARD_PERSISTDIR");
500+
} else {
501+
if (getenv("XDG_STATE_HOME")) {
502+
global_path.persistent = getenv("XDG_STATE_HOME") / fs::path("clipboard");
503+
} else {
504+
global_path.persistent = global_path.home / constants.persistent_directory_name;
505+
}
506+
}
500507

501508
path = Clipboard(clipboard_name, clipboard_entry);
502509
}

0 commit comments

Comments
ย (0)