Skip to content

Instantly share code, notes, and snippets.

@jakeisnt
Created January 13, 2021 21:15
Show Gist options
  • Save jakeisnt/f6e19776d889e866659ca25841575f32 to your computer and use it in GitHub Desktop.
Save jakeisnt/f6e19776d889e866659ca25841575f32 to your computer and use it in GitHub Desktop.
Generate initial metadata for reMarkable tablet to detect PDFs
#!/usr/bin/env bash
#
# to use:
# - run this on a device with 'genuuid'
# - systemctl restart xochitl on the remarkable over ssh
# the two way sync thing really doesn't work, figure out a better way to handle this
# figure out how to get these things into my wiki! any reason to use zotero?
set -euo pipefail
if [[ $# != 2 ]]
then
echo "Expected 2 arguments: INPUT.PDF OUTPUT_DIR"
exit
fi
yourfilenames=`ls ./*.txt`
for eachfile in $yourfilenames
do
echo $eachfile
done
uuid=$(uuidgen)
cp $1 $2/${uuid}.pdf
cat << EOF > $2/${uuid}.metadata
{
"deleted": false,
"lastModified": "$(date +%s000)",
"metadatamodified": true,
"modified": true,
"parent": "",
"pinned": false,
"synced": false,
"type": "DocumentType",
"version": 0,
"visibleName": "$(basename $1)"
}
EOF
echo "Created $2/${uuid}.pdf"
echo "Created $2/${uuid}.metadata"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment