Last active
November 6, 2018 13:50
Revisions
-
razius revised this gist
Jan 20, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,8 @@ # detects a change it automatically refreshes the current selected Chrome tab or # window. # # http://razius.com/articles/auto-refreshing-google-chrome-on-file-changes/ # # Usage: # ./chrome-refresh.sh /folder/to/watch /some/folder/file_to_watch.html -
razius created this gist
Jan 19, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/bin/bash # # Watches the folder or files passed as arguments to the script and when it # detects a change it automatically refreshes the current selected Chrome tab or # window. # # Usage: # ./chrome-refresh.sh /folder/to/watch /some/folder/file_to_watch.html TIME_FORMAT='%F %H:%M' OUTPUT_FORMAT='%T Event(s): %e fired for file: %w. Refreshing.' while inotifywait -q -r --timefmt "${TIME_FORMAT}" --format "${OUTPUT_FORMAT}" "$@"; do CHROME_WINDOW_ID=$(xdotool search --onlyvisible --class google-chrome | head -1) xdotool key --window $CHROME_WINDOW_ID 'CTRL+r' done