Watchout
A cross platform reloading image viewer combined with a command executor.
Watchout will do any of the following:
- Run a
command
when any file in a set ofPaths
changes. After the command is done running, it will reload and display an image. Imagine you're working on a SQL query to generate a chart. Whenever you save the SQL file Watchout would run a specific command (saygenerate-chart.py query.sql
) and upon completion would reload the image that was generated bygenerate-chart.py
. - Check if an image on disk changed and if that is the case re-display the image.
Watchout should run cross platform, but it has only been tested on macOS.
Demo
(In this demo you can see watchout running cargo run --example image
whenever the image.rs
file is saved. The image
example writes output.png
to disk which is displayed by watchout.
Usage
Watchout has to be started from the terminal, quick example:
This will start watchout with an image and redisplay the image if it changes.
Running with a command. Below will run cargo run --example generate_image
whenever anything in /proj/bam/src
or /proj/bam/examples
changes. Once it finished running, it will reload /proj/bam/output.png
.
There's another mode where the output of the cmd
can define the image to be displayed. In this case, the last line of output from cmd
should only be the path to the image that is to be displayed:
In this example, whenever /proj/bam/src
changes, watchout will run cargo run --example generate_image
and then take the last line of output from running cargo run --example generate_image
, interpret that as the path to an image, and load that image.
Full Usage
Libraries
Watchout was build using these fine libraries