Publishing Tasks
Publishing tasks for others to install is a simple affair.
The Automated Way
The simplest way to publish a task is to use Figaro's Self-Publishing tool.
The Manual Way
If you'd prefer a more hands-on approach, there are only two steps required:
- Create a task definition file containing your script and name, description etc.
- Store it in a publically accessible location with a couple of links pointing to it.
1. Creating a Figaro Task Definition (FTD) file.
The FTD is simply a JSON file conforming to the following schema:
interface ITask {
title: string;
description: string;
script: string; //escaped string
color?: string; //hex RGB, e.g. #CC0000
autoRunOnConnect: boolean;
autoRunPriority: number;
autoLock: boolean;
}
Even if you plan to host your FTD yourself, You can still use the Self-Publishing tool to generate it.
2. Hosting and publishing installation links.
Script files are installed in Figaro via deep linking, which differs slightly depending if figaro is being run from a browser or the Android app.
Install to Browser
<a href="https://app.figaro.conryclan.com?INSTALL_TASK=<path-to-json>" target="figaro:app">Install task</a>
Install to Android App
<a href="figaro://open?INSTALL_TASK=<path-to-json>">Install task</a>
Common link
The following script may be used to install the FTD regardless of platform.
<button id="installBtn">Install My Script</button>
<script>
const isAndroid = /android/i.test(navigator.userAgent);
const urlPrefix = isAndroid
? "figaro://open?"
: "https://app.figaro.conryclan.com?";
const url = urlPrefix + "INSTALL_TASK=<path-to-json>"
document.getElementById("installBtn").addEventListener("click", () => {
window.open(url, "figaro:app");
});
</script>