diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2021-04-15 08:14:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2021-04-15 08:14:38 -0300 |
commit | 6a1add686c7b5b1dccdb2a9c3a9334fd8e030d68 (patch) | |
tree | 1c71def0e1073045e26478cb3723f450d395a9ff | |
parent | 9151606d519de344abb07f26eacc833be73e6732 (diff) | |
download | scripts-6a1add686c7b5b1dccdb2a9c3a9334fd8e030d68.tar.gz scripts-6a1add686c7b5b1dccdb2a9c3a9334fd8e030d68.tar.bz2 |
Feat: show: inotify watch support
-rwxr-xr-x | show | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -4,6 +4,7 @@ # # Parameters +PROGRAM="$0" BASENAME="`basename $0`" DOCS="$HOME/data/doc" FILELIST=".filelist" @@ -59,6 +60,14 @@ fi if [ "$ITEM" == "--search" ]; then shift grep -i -- "$*" $LIST +elif [ "$ITEM" == "--watch" ]; then + ( + cd $DOCS + + while inotifywait -e modify -e create -e move -e delete .; do + $PROGRAM --refresh + done + ) else grep -i -- "$ITEM" $LIST | while read entry; do echo "Opening $entry..." |