mirror of
https://github.com/vale981/website
synced 2025-03-04 17:11:40 -05:00
add post about kindle bodge
This commit is contained in:
parent
496d755ddc
commit
ad54bfcb1f
1 changed files with 99 additions and 1 deletions
100
content.org
100
content.org
|
@ -3022,6 +3022,105 @@ future.
|
||||||
|
|
||||||
#+CAPTION: And this is the result!
|
#+CAPTION: And this is the result!
|
||||||
[[attachment:2024-05-11_20-12-52_screenshot.png]]
|
[[attachment:2024-05-11_20-12-52_screenshot.png]]
|
||||||
|
*** DONE Kindle Scribe Sync :org:roam:emacs:python:python:
|
||||||
|
CLOSED: [2024-11-17 Sun 12:13]
|
||||||
|
:PROPERTIES:
|
||||||
|
:EXPORT_FILE_NAME: kindle-scribe-monitor
|
||||||
|
:ID: e8b12ed0-2a34-4ef3-a89a-716a6c26e191
|
||||||
|
:END:
|
||||||
|
TL;DR check out https://github.com/vale981/kindle_fetch.
|
||||||
|
|
||||||
|
|
||||||
|
I "recently" treated myself to a Kindle Scribe e-ink tablet which is
|
||||||
|
somewhat like a ReMarkable[fn:7] but on the cheap. There is no free
|
||||||
|
lunch however, and price you pay is a somewhat sub-par software. One
|
||||||
|
quite essential missing feature is convenient synchronization with
|
||||||
|
other devices. As I use the tablet mainly for calculations, I rely on
|
||||||
|
having the previous pages available at a glance (just as they would be
|
||||||
|
if I were using paper). Furthermore, I would like to integrate the
|
||||||
|
handwritten notes into my [[https://www.orgroam.com/][org-roam]] note taking system.
|
||||||
|
|
||||||
|
One solution would be to jailbreak the kindle, ssh into it and
|
||||||
|
automatically download a notebook when it changes. The conversion to
|
||||||
|
PDF could then be handled by the [[https://www.mobileread.com/forums/showthread.php?t=291290][Calibre KFX input plugin]]. However,
|
||||||
|
that ship has sailed for me as the firmware on my Kindle is too new.
|
||||||
|
|
||||||
|
This led me to come up with the following [[https://www.youtube.com/watch?v=lIFE7h3m40U][bodge]]. Amazon offers a
|
||||||
|
service that converts a notebook to PDF and sends it to your email
|
||||||
|
upon request and this we can exploit to our heart's content. I wrote a
|
||||||
|
[[https://github.com/vale981/kindle_fetch][script]] which monitors your email inbox via IMAP[fn:8] using [[https://github.com/bamthomas/aioimaplib][aioimaplib]]
|
||||||
|
and detects incoming emails from Amazon containing download links for
|
||||||
|
the exported notebooks. Once such an email is detected, the associated
|
||||||
|
PDF is downloaded into a directory on the local file system
|
||||||
|
(=~/kindle_dump= on my machine). The name is inferred from the contents
|
||||||
|
of the email, although at the moment this doesn't include any hint
|
||||||
|
about which folder in the directory structure on the Kindle it came
|
||||||
|
from. The email is then conveniently deleted so as to not clutter your
|
||||||
|
inbox[fn:9].
|
||||||
|
|
||||||
|
Additionally, the latest downloaded PDF is copied into to a file of
|
||||||
|
your choice (=~/kindle_dump/.latest= in my case). I then run =zathura
|
||||||
|
~/kindle_dump/.latest= which displays that PDF on my large 4K monitor
|
||||||
|
and auto refreshes each time a new Kindle email comes in. I also
|
||||||
|
configured Zathura to show four pages per row (=set pages-per-row 4=) so
|
||||||
|
that I can see eight pages at a glance (see figure below).
|
||||||
|
|
||||||
|
#+CAPTION: An example of what my ugly handwriting looks like :),
|
||||||
|
[[attachment:screen:d22fec54-83c6-4cc6-a701-c29270868804.png]]
|
||||||
|
|
||||||
|
Additionally, the following elisp snippet allows me to attach the
|
||||||
|
latest note to an org-roam node with a couple of keystrokes.
|
||||||
|
#+begin_src elisp
|
||||||
|
(defun attach-kindle-note (text)
|
||||||
|
"Attaches the latest kindle note to the current org buffer and links to it with TEXT."
|
||||||
|
(interactive "sText: ")
|
||||||
|
(let* ((name (org-id-new "kindle"))
|
||||||
|
(tmp (format "/tmp/%s.pdf" name))
|
||||||
|
(file "/home/hiro/kindle_dump/.latest.pdf")
|
||||||
|
(text (if (string-empty-p text)
|
||||||
|
(format "handwritten note %s" (current-time-string)) text)))
|
||||||
|
(copy-file file tmp t)
|
||||||
|
(org-attach-attach tmp nil 'mv)
|
||||||
|
(insert (format "[[attachment:%s.pdf][%s]]" name text))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
The integration into my note-taking system is the most important part
|
||||||
|
the whole bodge for me.
|
||||||
|
|
||||||
|
Annoyingly, Amazon has already changed the email format twice since I
|
||||||
|
initially hacked together this solution. However, each time I come up
|
||||||
|
with a more robust way to get the PDF download link and one's free
|
||||||
|
time has to be spent in some way or another anyways.
|
||||||
|
|
||||||
|
And if you're reading this sentence, you've made it to the end of this
|
||||||
|
rather redundant post. Thank you for reading. I hope that at least
|
||||||
|
some people find this bodge useful. If there's sufficient interest, I
|
||||||
|
might add OAuth2 support.
|
||||||
|
|
||||||
|
On the road-map for future (think of years, not months) posts are my
|
||||||
|
mu4e/mbsync setup with OAuth support on NixOS, my Xournal++ setup with
|
||||||
|
vim-like keybindings and a patch to make the output files more
|
||||||
|
compatible with version management and finally, my org-roam braindump.
|
||||||
|
|
||||||
|
In other news, my fork of [[https://github.com/vale981/julia-vterm.el][julia-vterm]] is now called
|
||||||
|
[[https://github.com/vale981/py-vterm-interaction.el][py-vterm-interaction]] and available on MELPA.
|
||||||
|
|
||||||
|
[fn:7]
|
||||||
|
Years ago, I sold my ReMarkable in to buy a cheap drum-set and used a
|
||||||
|
graphics tablet instead. I have a pretty neat set-up for that, too but
|
||||||
|
that's a tale for another time.
|
||||||
|
|
||||||
|
[fn:8]
|
||||||
|
Unfortunately, OAuth is not supported, so GMail/Outlook won't work out
|
||||||
|
of the box.
|
||||||
|
|
||||||
|
[fn:9]
|
||||||
|
I additionally have a Sieve filter running on my server that
|
||||||
|
automatically sorts the Kindle emails into a specific folder, although
|
||||||
|
that is not strictly necessary anymore. You might want to setup a
|
||||||
|
separate email account for this purpose altogether if you're not
|
||||||
|
comfortable with having a (potentially buggy) python script mucking
|
||||||
|
around in your emails.
|
||||||
|
|
||||||
** Uncategorized :@Uncategorized:
|
** Uncategorized :@Uncategorized:
|
||||||
*** Neuseeland Restauration
|
*** Neuseeland Restauration
|
||||||
|
@ -4854,5 +4953,4 @@ chaotisch.
|
||||||
# eval: (org-hugo-auto-export-mode)
|
# eval: (org-hugo-auto-export-mode)
|
||||||
# org-download-image-dir: "./static/images"
|
# org-download-image-dir: "./static/images"
|
||||||
# org-download-heading-lvl: 3
|
# org-download-heading-lvl: 3
|
||||||
# jinx-languages: "de_DE"
|
|
||||||
# End:
|
# End:
|
||||||
|
|
Loading…
Add table
Reference in a new issue