Skip to content

Instantly share code, notes, and snippets.

@SuperCowProducts
Created January 6, 2026 10:52
Show Gist options
  • Select an option

  • Save SuperCowProducts/af05f34f03197bfefc80712d96d54a1e to your computer and use it in GitHub Desktop.

Select an option

Save SuperCowProducts/af05f34f03197bfefc80712d96d54a1e to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
# echo $1
# ~~b/w/x/cr~~ € < Q137641294 #pp/k/b/c/d
# an-S() {
# cpdf -list-annotations-json "$1" | jq '.[][]["/Contents"]?["U"]? | select( . != null )' | grep --color=always -P "$2"
# }
NORMAL=$(tput sgr0)
BRIGHT=$(tput bold)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
cd ~/Nextcloud
IFS=$'\n'
for f in $(find ~+ -name "*.pdf"); do
#b/pp instead of double quotes have different types of separators telling you what page number annotation is+ author etc.
E="$(cpdf -list-annotations-json "$f" | jq '.[][]["/Contents"]?["U"]? | select( . != null )' | grep --color=always -P "$1")"
if ! [ -z "$E" ]; then
printf "${BLUE}${MAGENTA}${BRIGHT}${f}${NORMAL} : \n$E\n"
fi
done
# ta
#find -name "*.pdf" -exec 'cpdf -list-annotations-json {} \;#b/w/x | grep -P "$1" #2025-12-30T15;03;23,01;00 pdfcpu annotations list {} \;
#cpdf -list-annotations-json ~/Nextcloud/em/emacs.pdf | jq '.[][]["/Contents"]?["U"]? | select( . != null )' #2025-12-30T17;54;07,01;00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment