aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-08-02 23:57:34 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-08-02 23:57:34 -0300
commit889dbe5574fba55511329991f763031e2d7bc0e0 (patch)
tree1d1b7527c826f1f196b5e789e52d62bba5a493cc
parent5a97d8d46621fbb51c25a087eae55af33cbf8aa8 (diff)
downloadscripts-889dbe5574fba55511329991f763031e2d7bc0e0.tar.gz
scripts-889dbe5574fba55511329991f763031e2d7bc0e0.tar.bz2
Fix: show: use inotifier for the --watch option
-rwxr-xr-xshow12
1 files changed, 9 insertions, 3 deletions
diff --git a/show b/show
index af73a9d..a2a118c 100755
--- a/show
+++ b/show
@@ -44,8 +44,10 @@ if [ -z "$ARG" ]; then
echo " $BASENAME --watch <subfolder>"
echo " $BASENAME <item-name>"
exit 1
+
elif [ "$ARG" == "--refresh" ]; then
__update_filelist
+
elif [ ! -d "$DOCS" ]; then
echo "missing $DOCS folder"
exit 1
@@ -69,6 +71,7 @@ fi
if [ "$ARG" == "--search" ]; then
shift
grep -i -- "$*" $LIST
+
elif [ "$ARG" == "--details" ]; then
shift
entry="`echo $* | sed -e 's/^@//'`"
@@ -82,6 +85,7 @@ elif [ "$ARG" == "--details" ]; then
else
find $DOCS -name ${1}.bib -exec cat {} \;
fi
+
elif [ "$ARG" == "--watch" ]; then
# Convert symlink to full path and start inotifywait loop
folder="`readlink -f $DOCS`"
@@ -91,9 +95,11 @@ elif [ "$ARG" == "--watch" ]; then
#while inotifywait -e modify -e create -e move -e delete -r "$folder"; do
#while inotifywait -e modify -e move -r "$folder"; do
#while inotifywait -e modify -e move -r "$folder/$subfolder"; do
- while inotifywait -e modify -e create -e move -e delete -r "$folder/$subfolder"; do
- $PROGRAM --refresh
- done
+ #while inotifywait -e modify -e create -e move -e delete -r "$folder/$subfolder"; do
+ # $PROGRAM --refresh
+ #done
+ inotifier $PROGRAM --refresh
+
else
shift 2
EXTRA_ARGS="$*"