Skip to content

Commit

Permalink
Two pdf tools added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathanial Hendler committed Aug 12, 2016
0 parents commit 1eaa1d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pdf_monitor.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/bash
pdfjam `find . -type f -name '*pdf' -printf '%T@ %p\n' | sort -n | tail -8 | cut -f2- -d" "` --nup 3x3 --landscape --outfile ~/tmp/monitor.pdf
zathura ~/tmp/monitor.pdf &
inotifywait --recursive --monitor -e close_write,moved_to,create,delete . |
while read -r directory events filename; do
if [[ $filename == *pdf ]]; then
pdfjam `find . -type f -name '*pdf' -printf '%T@ %p\n' | sort -n | tail -9 | cut -f2- -d" "` --nup 3x3 --landscape --outfile ~/tmp/monitor.pdf
fi
done
5 changes: 5 additions & 0 deletions pdf_search.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/bash
function pdf {
#find . -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep -i --with-filename --label="{}" --color "$1"' \; 2> /dev/null
find . -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep -i --with-filename --label="{}" --color "'"$1"'"' \; 2> /dev/null
}

0 comments on commit 1eaa1d3

Please sign in to comment.