PackagesIf you're running a recent version of Ubuntu, you can get the two prerequisite packages directly using apt-get.
sudo apt-get install inotify-tools xdotool
- Load your development page in your favorite browser (I use Chromium in the example below)
- Open up a terminal in the same directory as the page and run the following script:
while(true); do inotifywait -q -e modify *.html *.css *.js xdotool search --onlyvisible --classname chromium-browser key F5 done
- In the script above, replace
*.html *.css *.jswith the specific files or wildcard specifiers that you want to watch for changes to. The browser is automatically refreshed when you save a change to any of the watched files. When you're done editing, kill the script with a Ctrl-C, or just close the terminal.