-
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 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",
},
},
],
}Every task requires a description and type fields, 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,Software\\Wine\\DllOverrides- mind the double backslash!) -
values: dictionary of Registry values to be applied -
filename: NEW! file of the registry hive to edit, useuser.regif unsure
-
filename: name of the file to be extracted -
path: target path to be extracted to
-
filename: name of the file to be extracted -
path: target path to be extracted to
-
name: name of the tweak to run
-
path: original path of the file to copy -
new_path: new path for the copy to exist at
-
path: path of the file to be deleted
-
path: path of the new file -
content: string value of the file contents
Can be used to move files!
-
path: path of the file -
new_path: new name/path of the file
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
-
action: eitherkillorwait- the first kills the wineserver forcibly, the other waits until it quits
-
values: dict of values to set -
path: name of the section to edit -
filename: path to the file
-
path: path to the file to replace text -
values: dict of values to replace
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
Shortcut for registering a DLL with regsvr32, might not work/be needed for all DLLs
-
path: DLL path to register
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
This has no arguments; it pauses execution until the user presses a key