Skip to content

Commit

Permalink
umu_consts: update umu standard paths (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN authored Oct 16, 2024
1 parent b11c740 commit ba9d24c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions umu/umu_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@
"getnativepath",
}

XDG_DATA_HOME: Path = (
Path(os.environ["HOST_XDG_DATA_HOME"])
if os.environ.get("HOST_XDG_DATA_HOME")
else (
Path(os.environ["XDG_DATA_HOME"])
if os.environ.get("XDG_DATA_HOME")
else Path.home().joinpath(".local", "share")
)
)

XDG_CACHE_HOME: Path = (
Path(os.environ["XDG_CACHE_HOME"])
if os.environ.get("XDG_CACHE_HOME")
Expand All @@ -40,6 +30,20 @@
# then $XDG_DATA_HOME as fallback, and will be required to update their
# manifests by adding the permission 'xdg-data/umu:create'.
# See https://github.com/Open-Wine-Components/umu-launcher/pull/229#discussion_r1799289068
match os.environ.get("container") == "flatpak": # noqa: SIM112
case True:
XDG_DATA_HOME: Path = (
Path(os.environ["HOST_XDG_DATA_HOME"])
if os.environ.get("HOST_XDG_DATA_HOME")
else Path.home().joinpath(".local", "share")
)
case False:
XDG_DATA_HOME: Path = (
Path(os.environ["XDG_DATA_HOME"])
if os.environ.get("XDG_DATA_HOME")
else Path.home().joinpath(".local", "share")
)

UMU_LOCAL: Path = XDG_DATA_HOME.joinpath("umu")

# Temporary directory for downloaded resources moved from tmpfs
Expand Down

0 comments on commit ba9d24c

Please sign in to comment.