Created
January 13, 2021 21:15
-
-
Save jakeisnt/f6e19776d889e866659ca25841575f32 to your computer and use it in GitHub Desktop.
Generate initial metadata for reMarkable tablet to detect PDFs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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