Productivity boost with entr
entr - run arbitrary commands when files change
entr was create by Eric Radman to run all his unit test when a source file was changed. I started using this late 2016 and I got an enourmous productivity boost out of it.
What is it?
A file watcher, that can trigger actions
How cool is it?
libinotify, watchman, bubblegum, xdotool, ..
When to use it?
When you want to automate some (development) processes
Is it dead?
Nope, but it is rather complete.
Where is it?
How to use it
sudo apt-get install entr
release: 3.6 usage: entr [-cdpr] utility [args, [/_], ...] < filenames
That does not tell us much but the man page and the official site is very extensive.
entr takes a list of files or directories as input and watches them. If there is a change it runs the
Following the manual, the '-c' flag, clears the console.
The combination i3, terminator, and bash history browsing may sometimes mess up some characters. I have not yet pinpointed the exact cause.
find ls /etc/postgresql/9.6/main/*.conf |entr -c service postgresql restart
-r flag, the
arg process is killed befor the
args are restarted.
The static website generator gutenberg, has a development mode (
serve) that watches the
content directories. Unfortunately, the theme directory and the main configfile are not watched.
For theme developers,
entr is a realy nice tool.
find ./theme/materialize config.toml -type f| entr -r /opt/gutenberg/target/release/gutenberg serve
We only tipped the top of the iceberg here. There are much more details in the man page and the official site.