-
Notifications
You must be signed in to change notification settings - Fork 0
Scripting Plugins
A plugin written for Lauf is essentially just a shell script. The only difference is a plugin script will communicate with Lauf by passing around shared variables and functions.
| 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 |
########################################################
# PLUGIN_NAME v0.3.0 #
# EMAIL
# Summary: #
# Most basic plugin ################################
# Usage: #
# Descripting on how to use plugin #######################
# Dependencies: #
# Any dependencies ######################################
########################################################
# Arguements for skipping GUI #
########################################################
if [ ! $lauf_exec2 = "" ]; then
$notify=$lauf_exec2
lauf_notify "You typed:" "$lauf_exec2"
return
fi
########################################################
# GUI Code #
########################################################
PLUGIN_NAME=$(zenity $lauf_app_options --entry --title="${lauf_app_name}" --text="Type something")
case $? in
0)
$notify=$PLUGIN_NAME
lauf_notify "You typed:" "$notify"
return;;
1)
lauf_notify "Canceled" "Cancel button was pressed"
exec $0;;
esac
| 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 |