1
1
#! /bin/sh
2
- # Transfer PDF file(s) to a reMarkable
2
+ # Transfer PDF and EPUB file(s) to a reMarkable
3
3
# Adrian Daerr and contributors, 2017 -- 2022 - public domain
4
+ # https://github.com/adaerr/reMarkableScripts
4
5
#
5
6
# - The files will appear in reMarkable's top-level "My Files" directory,
6
7
# - After finishing all transfers, you have to restart the xochitl
7
8
# service on the tablet in order to force a scan of its document
8
- # directory ${xochitldir} (so that you see the newly transferred
9
- # files), e.g. by sending the tablet the following command:
9
+ # directory ${REMARKABLE_XOCHITL_DIR} (so that you see the newly
10
+ # transferred files), e.g. by sending the tablet the following
11
+ # command:
10
12
# ssh remarkable systemctl restart xochitl
11
- # This script can do that for you at the end, either by default (set
12
- # environment variable RESTART_XOCHITL_DEFAULT to 1) or once when
13
- # given the command line parameter "-r" .
14
- # - See more instructions and configuration options below
13
+ # This script will do that for you at the end if you
14
+ # (set the environment variable RESTART_XOCHITL_DEFAULT to 1)
15
+ # xor (specify "-r" as first command line parameter) .
16
+ # - See list of prerequisites, and more environment variables below.
15
17
#
16
18
# Disclaimer and liability limitation:
17
19
# [see also all-caps text borrowed from GPL below]
49
51
#
50
52
# Prerequisites:
51
53
#
52
- # * The ssh access has to be configured under the host alias 'remarkable',
53
- # e.g. by putting the following in .ssh/config :
54
- # | host remarkable
55
- # | Hostname 10.11.99.1
56
- # | User root
57
- # | ForwardX11 no
58
- # | ForwardAgent no
59
- # See also the variable "xochitldir" below
54
+ # * The ssh access has to be configured under the host alias 'remarkable'
55
+ # (or another alias specified in the env variable REMARKABLE_HOST),
56
+ # e.g. by putting the following in .ssh/config :
57
+ # | host remarkable
58
+ # | Hostname 10.11.99.1
59
+ # | User root
60
+ # | ForwardX11 no
61
+ # | ForwardAgent no
62
+ # (and setup ssh public key authentication to avoid typing your passwd)
60
63
#
61
64
# * Beyond core utilities (date, basename,...), the following software
62
65
# has to be installed on the host computer:
63
- # - uuidgen
66
+ # - uuidgen
64
67
65
68
# This is where ssh will try to copy the files associated with the document
66
69
REMARKABLE_HOST=${REMARKABLE_HOST:- remarkable}
@@ -69,8 +72,9 @@ TARGET_DIR="${REMARKABLE_HOST}:${REMARKABLE_XOCHITL_DIR}"
69
72
70
73
# Check if we have something to do
71
74
if [ $# -lt 1 ]; then
72
- echo " Transfer PDF or Epub document to a reMarkable tablet"
73
- echo " usage: $( basename $0 ) [ -r ] path-to-pdf-file [path-to-pdf-file]..."
75
+ echo " Transfer PDF or EPUB document(s) to a reMarkable tablet."
76
+ echo " See comments/documentation at start of script."
77
+ echo " usage: $( basename $0 ) [ -r ] path-to-file [path-to-file]..."
74
78
exit 1
75
79
fi
76
80
90
94
tmpdir=$( mktemp -d)
91
95
92
96
# Loop over the command line arguments,
93
- # which we expect are paths to the PDF files to be transferred
97
+ # which we expect are paths to the files to be transferred
94
98
for filename in " $@ " ; do
95
99
96
100
# reMarkable documents appear to be identified by universally unique IDs (UUID),
0 commit comments