Skip to content

Commit

Permalink
Merge pull request #3112 from koplo199/bottlesdevs-pr
Browse files Browse the repository at this point in the history
fix: MangoHud, gamescope and vkBasalt versions
  • Loading branch information
mirkobrombin authored Dec 1, 2023
2 parents 065c66a + 1487e65 commit 9304cf4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion bottles/backend/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from functools import lru_cache
from pathlib import Path
from typing import Dict

from bottles.backend.utils import yaml, json

@lru_cache
class Paths:
Expand Down Expand Up @@ -79,6 +79,9 @@ class TrdyPaths:
mangohud_available = shutil.which("mangohud") or False
obs_vkc_available = shutil.which("obs-vkcapture") or False
vmtouch_available = shutil.which("vmtouch") or False
base_version = ""
if os.path.isfile("/app/manifest.json"):
base_version = json.load(open("/app/manifest.json")).get("base-version","").removeprefix("stable-")

# encoding detection correction, following windows defaults
locale_encodings: Dict[str, str] = {
Expand Down
14 changes: 9 additions & 5 deletions bottles/frontend/views/bottle_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from gi.repository import Gtk, Adw

from bottles.backend.globals import gamemode_available, vkbasalt_available, mangohud_available, obs_vkc_available, \
vmtouch_available, gamescope_available
vmtouch_available, gamescope_available, base_version
from bottles.backend.logger import Logger
from bottles.backend.managers.library import LibraryManager
from bottles.backend.managers.runtime import RuntimeManager
Expand Down Expand Up @@ -194,11 +194,15 @@ def __init__(self, details, config, **kwargs):
self.switch_vmtouch.set_sensitive(vmtouch_available)
_not_available = _("This feature is unavailable on your system.")
_flatpak_not_available = _("{} To add this feature, please run flatpak install").format(_not_available)
_gamescope_pkg_name = "org.freedesktop.Platform.VulkanLayer.gamescope"
_vkbasalt_pkg_name = "org.freedesktop.Platform.VulkanLayer.vkBasalt"
_mangohud_pkg_name = "org.freedesktop.Platform.VulkanLayer.MangoHud"
_obsvkc_pkg_name = "com.obsproject.Studio.Plugin.OBSVkCapture"
_flatpak_pkg_name = {
"gamescope": "org.freedesktop.Platform.VulkanLayer.gamescope",
"vkbasalt": "org.freedesktop.Platform.VulkanLayer.vkBasalt//22.08",
"mangohud": "org.freedesktop.Platform.VulkanLayer.MangoHud//22.08",
"obsvkc": "com.obsproject.Studio.Plugin.OBSVkCapture"
"gamescope": f"{_gamescope_pkg_name}//{base_version}" if base_version else _gamescope_pkg_name,
"vkbasalt": f"{_vkbasalt_pkg_name}//{base_version}" if base_version else _vkbasalt_pkg_name,
"mangohud": f"{_mangohud_pkg_name}//{base_version}" if base_version else _mangohud_pkg_name,
"obsvkc": _obsvkc_pkg_name
}

if not gamemode_available:
Expand Down

0 comments on commit 9304cf4

Please sign in to comment.