From a1ec4771740d321df4480e8a7224fa10b59f0569 Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Fri, 3 Apr 2026 22:46:48 +0200 Subject: Update repo with git init directly in home dir --- .config/nushell/remarkable.nu | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .config/nushell/remarkable.nu (limited to '.config/nushell/remarkable.nu') diff --git a/.config/nushell/remarkable.nu b/.config/nushell/remarkable.nu new file mode 100644 index 0000000..8a5522c --- /dev/null +++ b/.config/nushell/remarkable.nu @@ -0,0 +1,18 @@ +export def upload [file: path] { + let filename = ($file | path parse | get stem) + let extension = ($file | path parse | get extension) + curl $"http://($env.REMARKABLE_IP)/upload" -H "Origin: http://192.168.178.24" -H "Referer: http://192.168.178.24" -H 'Connection: keep-alive' -F $"file=@($file);filename=($filename);type=application/($extension)" +} + +export def download [collection_id?: string] { + curl $"http://($env.REMARKABLE_IP)/documents/($collection_id)" + | from json + | select VissibleName ID Type + | input list + | if $in.Type == 'DocumentType' { + let name = $in.VissibleName; + curl $"http://($env.REMARKABLE_IP)/download/($in.ID)/pdf" | save -f $"($name | str snake-case).pdf" + } else { + download $in.ID + } +} -- cgit v1.2.3