Skip to content

Commit

Permalink
Quick fix for paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Slackadays committed Dec 17, 2023
1 parent 2751309 commit 9af03b2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/cb/src/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,15 @@ void setFilepaths() {
: fs::temp_directory_path())
/ constants.temporary_directory_name;

global_path.persistent =
(getenv("CLIPBOARD_PERSISTDIR") ? getenv("CLIPBOARD_PERSISTDIR") : (getenv("XDG_STATE_HOME") ? getenv("XDG_STATE_HOME") : global_path.home)) / constants.persistent_directory_name;
if (getenv("CLIPBOARD_PERSISTDIR")) {
global_path.persistent = getenv("CLIPBOARD_PERSISTDIR");
} else {
if (getenv("XDG_STATE_HOME")) {
global_path.persistent = getenv("XDG_STATE_HOME") / fs::path("clipboard");
} else {
global_path.persistent = global_path.home / constants.persistent_directory_name;
}
}

path = Clipboard(clipboard_name, clipboard_entry);
}
Expand Down

0 comments on commit 9af03b2

Please sign in to comment.