Skip to content

Commit

Permalink
Fix koreader not using XDG_CONFIG_HOME on linux (#8507)
Browse files Browse the repository at this point in the history
  • Loading branch information
aruZeta committed Dec 5, 2021
1 parent c676aa6 commit f82ead2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions datastorage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ function DataStorage:getDataDir()
-- confined ubuntu app has write access to this dir
data_dir = string.format("%s/%s", os.getenv("XDG_DATA_HOME"), package_name)
elseif os.getenv("APPIMAGE") or os.getenv("KO_MULTIUSER") then
local user_rw = jit.os == "OSX" and "Library/Application Support" or ".config"
data_dir = string.format("%s/%s/%s", os.getenv("HOME"), user_rw, "koreader")
if os.getenv("XDG_CONFIG_HOME") then
data_dir = string.format("%s/%s", os.getenv("XDG_CONFIG_HOME"), "koreader")
else
local user_rw = jit.os == "OSX" and "Library/Application Support" or ".config"
data_dir = string.format("%s/%s/%s", os.getenv("HOME"), user_rw, "koreader")
end
else
data_dir = "."
end
Expand Down

0 comments on commit f82ead2

Please sign in to comment.