PS this is my fist post on dev.to :)
entr is a command line utility to run commands when file(s) change. Meaning,
entr can be used for anything, ranging from a LaTex recompilation to updating your status bar!
entr should be available in most
*nix distributions' package repos. Use the package manager to install it. Check out the github repo for more info on compiling it manually.
Lets assume you have a LaTex file named
notes.tex. Now, to recompile the LaTex document, we need to run
pdflatex notes.tex notes.pdf. Lets automate this. The general way to run
ls <name of file> | entr <command to execute>
so, changing it to our needs,
ls notes.tex | entr pdflatex notes.tex notes.pdf
Here are a few useful options for entr,
-p-> Don't run the command at startup
$SHELLto evaluate the command
-c-> Clear the screen before starting
entr while it is running, press
To execute the command immediately, press
entr (1) for info on other options.
Check out a video tutorial on