GliderGeek / pocket2rm

get articles from read-later platform pocket to the remarkable paper tablet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

run on remarkable itself

GliderGeek opened this issue · comments

working example:
https://github.com/Evidlo/remarkable_news

steps:

  • find out where articles are saved. determine pocket folder
  • manually copy files to remarkable with scp
    • files (epub and pdf) are present after shut-down and restart
    • go-code to generate necessary files
    • try if are present after restarting service
    • get files present without restart
  • compile service which gets a single document (PDF) when connected to wifi
    • only gets if document is not already present (only gets it once)

articles saved under ~/.local/share/remarkable/xochitl/

for PDF (following https://github.com/nick8325/remarkable-fs/blob/master/remarkable_fs/documents.py):

  • three files should be created:
    • {UUID4}.pdf / {UUID4}.epub
    • {UUID4}.metadata
    • {UUID4}.content

when the remarkable is switched off and on, the file then appears (and more files are generated with thumbnails etc...)

so it seems some sort of update script is called. how to trigger this update?
how does remarkable_fs do this?

it seems they do it be stopping the service:
https://github.com/nick8325/remarkable-fs/blob/e322a3d0b0672c9a67730bfe5e148dbb704964df/remarkable_fs/connection.py#L34

{UUID4}.content:

{
    "extraMetadata": {},
    "fileType": "pdf",
    "fontName": "",
    "lastOpenedPage": 0,
    "lineHeight": -1,
    "margins": 100,
    "orientation": "portrait",
    "pageCount": 1,
    "textScale": 1,
    "transform": {
        "m11": 1,
        "m12": 0,
        "m13": 0,
        "m21": 0,
        "m22": 1,
        "m23": 0,
        "m31": 0,
        "m32": 0,
        "m33": 1
    }
}

{UUID4}.metadata :

{
    "deleted": false,
    "lastModified": "1588012868000",
    "metadatamodified": false,
    "modified": false,
    "parent": {PARENT_UUID4},
    "pinned": false,
    "synced": false,
    "type": "DocumentType",
    "version": 1,
    "visibleName": {NAME}
}

commands to copy over files:

scp {UUID4}.pdf root@10.11.99.1:/home/root/.local/share/remarkable/xochitl/{UUID4}.pdf
scp {UUID4}.metadata root@10.11.99.1:/home/root/.local/share/remarkable/xochitl/{UUID4}.metadata
scp {UUID4}.content root@10.11.99.1:/home/root/.local/share/remarkable/xochitl/{UUID4}.content

done