Sirmentio/protontricks

Protontricks doesn't know about $STEAM_DIR/compatibilitytools.d/

Opened this issue · 1 comments

tam1m commented

Steam allows adding custom versions of Proton using the compatibilitytools.d directory in $STEAM_DIR.

Example:
/home/$USER/.local/share/Steam/compatibilitytools.d/Proton 3.16 dxvk-master/

Inside Proton 3.16 dxvk-master/ is a file compatibilitytool.vdf, which Steam reads to register the installed version.

compatibilitytool.vdf:

"compatibilitytools"
{
  "compat_tools"
  {
    "Proton 3.16 dxvk-master" // Internal name of this tool
    {
      // Can register this tool with Steam in two ways:
      //
      // - The tool can be placed as a subdirectory in compatibilitytools.d, in which case this
      //   should be '.'
      //
      // - This manifest can be placed directly in compatibilitytools.d, in which case this should
      //   be the relative or absolute path to the tool's dist directory.
      "install_path" "."

      // For this template, we're going to substitute the display_name key in here, e.g.:
      "display_name" "Proton 3.16 dxvk-master"

      "from_oslist"  "windows"
      "to_oslist"    "linux"
    }
  }
}

The "display_name" key is optional. If not set, Steam will use the internal name as display name

If compatibilitytool.vdf is user-created, then we'll probably have to use an actual VDF parser instead of rough regexes to make sure it's reliable. That in turn means that the current wget PROTONTRICKS_URL; chmod +x protontricks; mv protontricks /usr/bin/protontricks installation one-liner wouldn't work anymore since we have a dependency on a third-party package (vdf on PyPi).

At that point this script would be better published as a PyPI package. Installing with pip would still be as easy, since it's included out-of-the-box with Python 3.4 and up:
python3 -m pip install protontricks

I think it's up to @Sirmentio whether he wants to do that.