add dynamic config commands

This commit is contained in:
2026-05-22 18:11:08 +01:00
parent 1bf8e41e0c
commit c3b05c6bcb
8 changed files with 110 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ such as nginx or caddy.
1. install requirements: `pip install -r requirements.txt`
2. run: `python main/src.py [-c config-file] [-L]`.
## docker
### docker
a [dockerfile](./Dockerfile) and [compose file](./compose.yaml) have been provided.
keep in mind the commands will run in the docker container, too.
@@ -37,6 +37,36 @@ RUN apt-get update && apt-get install blahblahblah
CMD [ "python", "-u", "./src/main.py", "-c", "/config.toml" ]
```
## writing commands
### basic
basic commands return just text.
the text can end in 0 or 1 newlines but not multiple,
else it will be interpreted as a dynamic config command.
### dynamic config commands
any config can be dynamically set by preceeding the text to be printed
with TOML config:
```
template = "pat/to/templat.gif"
font = "fonts/custom_font.bdf"
text_offset = [20, 4]
hello world
```
if you do not want to print any text,
simply leave an extra blank/empty line
(the text ends in two newlines)
or a space character:
```
template = "pat/to/templat.gif"
```
## config
the provided [example config file](./config.toml) lists all the options that can be used.