Added ability to supply JSON from standard input

This commit is contained in:
2026-03-30 17:28:36 +03:00
parent a80e23614d
commit 6b22d8465e
4 changed files with 40 additions and 6 deletions

View File

@@ -9,13 +9,26 @@ You will need the following packages: `build-essential` `libsdl2-dev` `libsdl2-i
Just run `make` and an executable called `trmnl_sdl` should be produced.
# How to use
1. You will need to write a JSON config file.
It can either be named `config.json` or you will need to pass it as the first command line parameter to the executable.
### General use
1. You will need to write a JSON config file named `config.json`.
An example structure of the config file can be found in `config_example.json`.
You can find more info on the available Widgets and their parameters at the end of this file.
2. Run the executable
3. Convert the image to a suitable format via an ImageMagick command from below.
### Different ways to supply JSON
1. Default
* Command: `./trmnl_sdl`
* JSON Used: `config.json`
2. Specified file
* Command: `./trmnl_sdl path/to/json/file.json`
* JSON Used: `path/to/json/file.json`
3. Standard input
* Command: `./trmnl_sdl -`
* JSON Used: Supplied on the standard input for the process.
# ImageMagick commands to prepare image for TRMNL device
### Convert image without dithering
`convert trmnl.png -monochrome -colors 2 -depth 1 -strip png:output.png`