Skip to content

Commit

Permalink
Make changes to enable standalone Flatpak
Browse files Browse the repository at this point in the history
Make changes to the code to enable Protontricks to work as a standalone
Flatpak application.

See:
flathub/com.valvesoftware.Steam.Utility.protontricks#30
  • Loading branch information
Matoking committed Aug 25, 2021
1 parent 4b80986 commit ef44afc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
<id>com.valvesoftware.Steam.Utility.protontricks</id>
<component type="console-application">
<id>com.github.Matoking.protontricks</id>
<extends>com.valvesoftware.Steam</extends>
<name>protontricks</name>
<summary>A simple wrapper that does winetricks things for Proton enabled games.</summary>
Expand All @@ -12,6 +12,10 @@
<caption>App selection screen</caption>
</screenshot>
</screenshots>
<content_rating type="oais-1.1"/>
<description>
<p>A simple wrapper that does winetricks things for Proton enabled games.</p>
</description>
<url type="homepage">https://github.com/Matoking/protontricks/wiki</url>
<url type="help">https://github.com/Matoking/protontricks/wiki</url>
<url type="bugtracker">https://github.com/Matoking/protontricks/issues</url>
Expand Down
11 changes: 9 additions & 2 deletions src/protontricks/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import vdf

from .util import lower_dict
from .util import lower_dict, is_flatpak_sandbox

__all__ = (
"COMMON_STEAM_DIRS", "SteamApp", "find_steam_path",
Expand Down Expand Up @@ -295,7 +295,14 @@ def has_runtime_dir(path):

return None, None

for steam_path in COMMON_STEAM_DIRS:
# If we're inside a Flatpak sandbox, only search for it specifically
steam_dirs_to_search = (
[".var/app/com.valvesoftware.Steam/data/Steam"]
if is_flatpak_sandbox()
else COMMON_STEAM_DIRS
)

for steam_path in steam_dirs_to_search:
# The common Steam directories are found inside the home directory
steam_path = Path.home() / steam_path
if has_steamapps_dir(steam_path):
Expand Down

0 comments on commit ef44afc

Please sign in to comment.