Skip to content

Commit

Permalink
umu_consts: detect flatpak according to container interface
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Aug 14, 2024
1 parent 22786be commit 1e233cb
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions umu/umu_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,16 @@ class Color(Enum):
"getnativepath",
}

FLATPAK_ID = os.environ.get("FLATPAK_ID") or ""

FLATPAK_PATH: Path | None = (
# Installation path of the runtime files
# Flatpak will be detected via the Container Interface outlined by systemd
# See https://systemd.io/CONTAINER_INTERFACE
UMU_LOCAL: Path = (
Path.home().joinpath(
".var", "app", "org.openwinecomponents.umu.umu-launcher", "data", "umu"
)
if FLATPAK_ID
else None
)

UMU_LOCAL: Path = FLATPAK_PATH or Path.home().joinpath(
".local", "share", "umu"
if os.environ.get("container") == "flatpak" # noqa: SIM112
else Path.home().joinpath(".local", "share", "umu")
)

# Constants defined in prctl.h
# See prctl(2) for more details
PR_SET_CHILD_SUBREAPER = 36

0 comments on commit 1e233cb

Please sign in to comment.