For extending the functionality of Rune
Requirements: Theos
-
Start by cloning this repo to your machine
-
Run
plugin-gen.sh
to create a new plugin. It will ask you for some details before setting up the project.
-
cd
into the newly created directory and compile the plugin usingmake package
. If you are compiling for a rootless jailbreak, appendTHEOS_PACKAGE_SCHEME=rootless
to the command. -
If the compilation was successful, you should have a
.deb
file in thepackages
directory. After installing the package and respringing, it should appear within Rune's panel selection.
After enabling the plugin, you should see its panel show up within Rune.
Now that you have a plugin set up, you can edit Tweak.x
to build your UI and add functionality.
The plugin-gen.sh
script creates a subclass of BBRBasePanelView for you automatically. This is the class that you should use to build your panel.
The didMoveToWindow
method is called when the panel is (re)loaded by Rune. Use this to set up your panel's UI and any other initialisation code.
As each plugin is a Substrate tweak, you can hook methods just like you would in any other tweak.
Rune uses NSNotificationCenter to communicate with plugins. You can listen for notifications by adding an observer in your panel's didMoveToWindow
method.
Here is an example of how to listen for the com.icraze.rune-opened
notification, to call a method named updatePanel
whenever Rune is presented:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updatePanel) name:@"com.icraze.rune-opened" object:nil];
Available notifications:
com.icraze.rune-opened
- Fired when Rune is presented
com.icraze.rune-closed
- Fired when Rune is dismissed
The icon
field within the plugin's plist must be the name of an SF Symbol. Be sure to choose a symbol that is available on iOS 14 and above, as Rune supports these versions.