-
Notifications
You must be signed in to change notification settings - Fork 5
Creating Tweaks
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.
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",
"values": {
"winhttp": "native,builtin"
}
}
]
}Every task requires a description and type, as well as other arguments depending on the task type.
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)
As seen with the tweak above, there are numerous task types, listed below with their arguments:
-
filename: filename to be saved as -
checksum: expected sha256 checksum of the downloaded file -
url: URL to the file being downloaded
-
filename: filename of the exe file to run
-
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
-
filename: Name of the file to be extracted -
path: target path to be extracted to -
method: format of the file to extract (currently onlyzipis supported)
-
path: path to the original file -
new_path: path to the new file, not always required -
contents: only required forcreateop, contents of the created file -# copy/delete/create/rename
-
name: name of the tweak to run