Skip to content

Creating Tweaks

Wojtmic edited this page Dec 25, 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 loaders.bepinex 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: "41a089e5b1b1f0713b331346baf6677b1184c69eabebf51101097954e854c749",
            filename: "bepinex.zip",
        },
        {
            description: "Extract pack",
            type: "extract",
            filename: "bepinex.zip",
            path: "<gamedir>",
            method: "zip",
        },
        {
            description: "Add winhttp override",
            type: "regedit",
            path: "Software\\Wine\\DllOverrides",
            filename: 'user.reg',
            values: {
                winhttp: "native,builtin",
            },
        },
    ],
}

Common values

Every task requires a description and type fields, 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, Software\\Wine\\DllOverrides - mind the double backslash!)
  • values: dictionary of Registry values to be applied
  • filename: NEW! file of the registry hive to edit, use user.reg if unsure

Extraction (extract)

  • filename: name of the file to be extracted
  • path: target path to be extracted to

CAB Extraction (cabextract)

  • filename: name of the file to be extracted
  • path: target path to be extracted to

Run Tweak (tweak)

  • name: name of the tweak to run

Copy (copy)

  • path: original path of the file to copy
  • new_path: new path for the copy to exist at

Delete (delete)

  • path: path of the file to be deleted

Create (create)

  • path: path of the new file
  • content: string value of the file contents

Rename (rename)

Can be used to move files!

  • path: path of the file
  • new_path: new name/path of the file

Install Font (install_font)

Shortcut for copying and registering a font in the registry.

  • filename: path to the font file
  • name: name of the font to register as for Wine

Wineserver Control (wineserver)

  • action: either kill or wait - the first kills the wineserver forcibly, the other waits until it quits

INI Editor (edit_ini)

  • values: dict of values to set
  • path: name of the section to edit
  • filename: path to the file

Text replace (text_replace)

  • path: path to the file to replace text
  • values: dict of values to replace

Linux Shell Execution (shell)

The user is heavily warned when this action is performed (unless skipped with PF_ALLOW_SHELL=true).

  • path: path to the command
  • args: list of arguments

Register DLL (register_dll)

Shortcut for registering a DLL with regsvr32, might not work/be needed for all DLLs

  • path: DLL path to register

Print message (message)

As the name suggests, this prints a message to the user's terminal - however, Prefixer is descriptive when running tasks and this bypasses any form of "quiet mode" and is designed to use by warnings, not as a status update

  • content: content to print

Pause execution (pause)

This has no arguments; it pauses execution until the user presses a key