A cross platform reloading image viewer combined with a command executor.
Watchout will do any of the following:
- Run a
commandwhen any file in a set of
Pathschanges. 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 (say
generate-chart.py query.sql) and upon completion would reload the image that was generated by
- 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.
(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.
Watchout has to be started from the terminal, quick example:
watchout image -img /path/to/image.png
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/examples changes. Once it finished running, it will reload
watchout command-image -c "cargo run --example generate_image" -w /proj/bam/src -w /proj/bam/examples -i /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:
watchout command-output -c "cargo run --example generate_image" -w /proj/bam/src
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.
-h, --help Print help information
-V, --version Print version information
command-image Perform [cmd] when the [watch] folder (recursively) changes and then
command-output Perform [cmd] when the [watch] folder (recursively) changes and then
reload the image at the path in the last line of the [cmd] output
help Print this message or the help of the given subcommand(s)
image Reload [img] when it changes
cargo build --release
If you want your executable to have a proper icon, you can use
cargo bundle (
cargo install cargo-bundle):
cargo bundle --release
Or, on macOS
- Better error handling (e.g. displaying an error)
- Allow manually reloading an image / running the command
- Allow zooming / panning of the image
- Show the log output in the app
Watchout was build using these fine libraries