aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 5120e9151c90848b27b61863eca13ed49273a786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
qm plugin protocol with example. A "file manager" plugin example is written in shell script, python and zig

# Protocol
## Input
Plugins get inputs as environment variables.\
The environment variable `ACTION` is set to `get` to get data.\
The environment variable `URL` is set to _url_ relevant to the page, so for example for a file manager `URL` is set to the directory to display files of.
## Output
Plugins output data by writing lines to stdout.\
Data is first written to stdout and then a _command_ is written to stdout.\
First `add_tab` command is expected, followed by multiple `add_body_item`. The body items are put in the tab that is output before the body items.
### add_tab
The add_tab command expects `title` data, for example:
```bash
echo "title Files"
echo "add_tab"
```
### add_body_item
The add_body_item command expects `title` and `url` data and optionally `thumbnail_url` and `thumbnail_size`, for example:
```bash
echo "title file.png"
echo "url img1.png"
echo "thumbnail_url img1.png"
echo "thumbnail_size 1920x1080"
echo "add_body_item"

echo "title img2.png"
echo "url img2.png"
echo "thumbnail_url img2.png"
echo "thumbnail_size 1280x720"
echo "add_body_item"
```