reSnap icon indicating copy to clipboard operation
reSnap copied to clipboard

Feature request: prepend notebook name into the filename of the screenshot

Open ryanmccool opened this issue 2 years ago • 10 comments

Hi There, Great tool you have here and I'm finding some solid value with it.

One quick request would be to give the option via a flag to prepend the name of the Remarkable Notebook onto the filename for easier automation down the line.

Thanks.

ryanmccool avatar Dec 12 '22 17:12 ryanmccool

Hi.

Sorry but I have no idea, how I could get the information, wich notebook is currently opened.

If you find a way you could let me know or implement it and open a PR.

cloudsftp avatar Dec 12 '22 18:12 cloudsftp

I couldn't find a direct call on active notebook name, but here is a repo showing where to see notebook names and last modified date. Might be worth exploring... ? https://github.com/oisinmulvihill/remarkable-friend

ryanmccool avatar Dec 12 '22 19:12 ryanmccool

@ryanmccool this seems to do the trick,

FILENAME=$(ssh_cmd "basename \$(ls -t /home/root/.local/share/remarkable/xochitl | head -n 1) | cut -d '.' -f 1")
METADATA=$(ssh_cmd "cat /home/root/.local/share/remarkable/xochitl/$FILENAME.metadata")
echo "$FILENAME"
echo "$METADATA"
700a5723-8ee4-447e-9cee-e1821d1fb734
{
    "createdTime": "1723586270943",
    "lastModified": "1723773221422",
    "lastOpened": "1723773221716",
    "lastOpenedPage": 18,
    "parent": "",
    "pinned": false,
    "type": "DocumentType",
    "visibleName": "Quick sheets"
}

404Wolf avatar Aug 15 '24 23:08 404Wolf

@cloudsftp is this still something you'd be open to a PR for? I'm not entirely sure what data people would want out of it, but the uuid and page makes sense to me

404Wolf avatar Aug 15 '24 23:08 404Wolf

@404Wolf This is pretty cool, nice work.

I think the most relevant data for users is visibleName. Perhaps use it for the output file name if no other file name is specified (with a timestamp appended to it).

But also I'd like to keep the jq dependency optional, so maybe run a check first and only use the timestamp as the output file name?

Thanks for your work. I will get to your PRs soon.

PS. Please target latest with you PRs, I forgor to delete the develop branch 💀

cloudsftp avatar Aug 16 '24 04:08 cloudsftp

@404Wolf This is pretty cool, nice work.

I think the most relevant data for users is visibleName. Perhaps use it for the output file name if no other file name is specified (with a timestamp appended to it).

But also I'd like to keep the jq dependency optional, so maybe run a check first and only use the timestamp as the output file name?

Thanks for your work. I will get to your PRs soon.

PS. Please target latest with you PRs, I forgor to delete the develop branch 💀

Oh, yeah thanks for letting me know! I will fix that. And I've eliminated the jq dependency by ls-ing with -t or --time (I need to play around more to get it right), which sorts by modification date (who would've known -- no questionable awk!).

I'm thinking that we default to naming the file the visible name, yeah, but have a -uuid flag to name it the uuid (one can get the visible name from the uuid trivially, but not vice versa, so the option would be good.

404Wolf avatar Aug 16 '24 06:08 404Wolf

You can get the full path too, like /foo/bar/buzz, but that requires recursion, which is usually where I stop using bash (but could be done)

404Wolf avatar Aug 16 '24 06:08 404Wolf

Also I've managed to get a better color curve, which is currently part of a longer python script, but I can get to bashifying it. The main issue with the current color correction is that it totally gets rid of gridlines.

Thanks for creating reSnap, it's been a very positive inspiration :)

404Wolf avatar Aug 16 '24 06:08 404Wolf

Originally, I just wanted to prepare the argument handling - but I ended up implementing the feature.

https://github.com/cloudsftp/reSnap/pull/21 It's not perfect yet, but what do you think?

I want to keep the configuration options low, so I don't want to include the --uuid option or the full path of the notebook.

cloudsftp avatar Aug 16 '24 19:08 cloudsftp

Originally, I just wanted to prepare the argument handling - but I ended up implementing the feature.

#21 It's not perfect yet, but what do you think?

I want to keep the configuration options low, so I don't want to include the --uuid option or the full path of the notebook.

Could we put the uuid into stdout so that people can use it if they want, just so it's there if people want to parse it out of the output? Otherwise this seems good, I'll try it a little later!

404Wolf avatar Aug 17 '24 14:08 404Wolf