-
Notifications
You must be signed in to change notification settings - Fork 0
Scripting Plugins
So you want to start scripting your own plugins eh? Great! Before you start hacking away though, there’s a few things you should understand. A plugin for Lauf is essentially just a normal shell script. The only difference between a normal shell script and a Lauf plugin is that Lauf passes on information to it’s plugins by using shared functions and variables.
| Function / Variable | Name | Usage | Description |
|---|---|---|---|
Function |
yarra |
yarra "Variable Name" "String" |
Allows you to split a string into multiple variables. Basically a fake array or sorts. |
Function |
lauf_notify |
lauf_notify "Heading" "Body" |
Allows a plugin to notify the user information. |
Variable |
$lauf_exec |
$lauf_exec |
Holds what ever was typed into Lauf |
Variable |
$lauf_exec1 |
$lauf_exec1 |
Holds the command or plugin name being used |
Variable |
$lauf_exec2 - $lauf_exec999 |
everything else |
The next unlimited number of variables hold anything else typed into Lauf |
Open the [[Example Plugin|http://github.com/joshua-redfield/lauf/blob/testing/dev/example.sh]] and look over these instructions below.
First, let’s go over the heading comments. The first three lines should be filled in accordingly, the name of the plugin, your email or contact info, and dependincies. Please note that the way plugin.sh (the lauf plugin manager) reads plugin data, you must make it all done on one line!
The 4th line is the plugin summary, What the plugin does in other words. When activating a plugin this information will be pulled to notify the user.
The 7th line should explain how to use the plugin, This will also be pulled to notify the user.
The 9th line is the plugin dependencies which will also be pulled to notify the user upon activating the plugin.
| Variable | Description |
|---|---|
$lauf_app_dir |
The directory where Lauf currently resides in |
$lauf_app_icon |
Location of where Lauf’s icon is located |
$lauf_version |
Version information |
$lauf_app_name |
Lauf’s application name |
$lauf_app_motto |
Lauf’s slogan |
$lauf_core_dir |
Location of core plugins |
$lauf_plugin_dir |
Location of external plugins |
$lauf_app_options |
General Lauf options, Allows plugins to grab information from lauf.cfg |