Skip to content

Creating Tweaks

Wojtmic edited this page Oct 3, 2025 · 4 revisions

Introduction

Prefixer stores tweaks in two directories:

  • ~/.config/prefixer/tweaks' for user tweaks
  • '/usr/share/prefixer/tweaks' for system/global tweaks

User tweaks have higher authority than system ones and Prefixer will never automatically install anything into the user tweaks directory. When developing your own tweaks, test them from the user directory. When publishing them via the AUR or another package-managed way, always install them into the system tweaks directory.

Task System

Tweaks consist of separate, small tasks to keep them simple and modular. A good example is the bepinex.json5 built-in tweak.

{
  "description": "BepInEx 5.4.23.3",
  "tasks": [
    {
      "description": "Download pack",
      "type": "download",
      "url": "https://github.com/BepInEx/BepInEx/releases/download/v5.4.23.3/BepInEx_win_x64_5.4.23.3.zip",
      "checksum": "f89f3f6b97e8f486ec8eeea489415d058233240fd6de79b3cbdd90e601fa6bbf",
      "filename": "bepinex.zip"
    },
    {
      "description": "Extract pack",
      "type": "extract",
      "filename": "bepinex.zip",
      "path": "<gamedir>", // <gamedir> gets replaced automatically with the game root
      "method": "zip"
    },
    { // This is required for BepInEx to work properly
      "description": "Add winhttp override",
      "type": "regedit",
      "path": "HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides",
      "contents": {
        "winhttp": "native,builtin"
      }
    }
  ]
}

Common values

Every task requires a description and type, as well as other arguments depending on the task type.

Paths

Task paths/target filenames are formatted by replacing special keywords with paths:

  • <gamedir>: directory to the game (the one shown from Steam when viewing local files)
  • <pfxdir>: directory of the wineprefix
  • <tempdir>: temporary working directory, created for the tweak (downloaded files are placed here)

Task Types

As seen with the tweak above, there are numerous task types, listed below with their arguments:

Download (download)

  • filename: filename to be saved as
  • checksum: expected sha256 checksum of the downloaded file
  • url: URL to the file being downloaded

Run Executable (runexe)

  • filename: filename of the exe file to run

Registry Edition (regedit)

  • path: path to the Windows registry key (for example, HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides - mind the double backslash!)
  • values: dictionary of Registry values to be applied

Extraction (extract)

  • filename: Name of the file to be extracted
  • path: target path to be extracted to
  • method: format of the file to extract (currently only zip is supported)

File Operation (fileop)

  • path: path to the original file
  • newPath: path to the new file, not always required
  • op: type of the operation to perform, supports: copy, rename, delete and create
  • contents: only required for create op, contents of the created file

Run Tweak (tweak)

  • name: name of the tweak to run

Clone this wiki locally