Skip to content

Commit

Permalink
Remove Proton installations from app listings
Browse files Browse the repository at this point in the history
Proton installations appear to create their own Wine prefixes since
November 2021 or so. Filter these apps from listings to prevent
confusion.
  • Loading branch information
Matoking committed Jan 7, 2022
1 parent ace4189 commit 96acfaa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Enable usage of Flatpak Protontricks with non-Flatpak Steam. Flatpak Steam is prioritized if both are found.

### Fixed
- bwrap is only disabled when the Flatpak installation is too old. Flatpak 1.12.1 and newer support sub-sandboxes.
- bwrap is only disabled when the Flatpak installation is too old. Flatpak 1.12.1 and newer support sub-sandboxes.
- Remove Proton installations from app listings

## [1.6.2] - 2021-11-28
### Changed
Expand Down
8 changes: 4 additions & 4 deletions src/protontricks/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def exit_(error):
# Run the GUI
if args.gui:
has_installed_apps = any([
app for app in steam_apps if app.prefix_path_exists and app.appid
app for app in steam_apps if app.is_windows_app
])

if not has_installed_apps:
Expand Down Expand Up @@ -234,7 +234,7 @@ def exit_(error):
search_query = " ".join(args.search)
matching_apps = [
app for app in steam_apps
if app.prefix_path_exists and app.name_contains(search_query)
if app.is_windows_app and app.name_contains(search_query)
]

if matching_apps:
Expand Down Expand Up @@ -273,8 +273,8 @@ def exit_(error):
try:
steam_app = next(
app for app in steam_apps
if not app.is_proton and app.appid == steam_appid
and app.prefix_path_exists)
if app.is_windows_app and app.appid == steam_appid
)
except StopIteration:
exit_(
"Steam app with the given app ID could not be found. "
Expand Down
4 changes: 2 additions & 2 deletions src/protontricks/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ def run_gui(args, input_=None, strip_nonascii=False):
str(appid2icon[app.appid]),
"{}: {}".format(app.name, app.appid)
]
for app in steam_apps if app.prefix_path_exists and app.appid
for app in steam_apps if app.is_windows_app
]
# Flatten the list
cmd_input = list(itertools.chain.from_iterable(cmd_input))
else:
args = _get_zenity_args()
cmd_input = [
'{}: {}'.format(app.name, app.appid) for app in steam_apps
if app.prefix_path_exists and app.appid
if app.is_windows_app
]

cmd_input = "\n".join(cmd_input)
Expand Down
7 changes: 7 additions & 0 deletions src/protontricks/steam.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ def is_tool(self):
"""
return (self.install_path / "toolmanifest.vdf").is_file()

@property
def is_windows_app(self):
"""
Return True if this app is a Windows app that's launched using Proton
"""
return not self.is_proton and self.prefix_path_exists and self.appid

@property
def proton_dist_path(self):
"""
Expand Down

0 comments on commit 96acfaa

Please sign in to comment.