summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2019-02-18 21:29:53 -0800
committerMike Crute <mike@crute.us>2019-02-18 21:29:54 -0800
commit1a6b4c5e12407271b55f620ba4cf5c5eeedc1f31 (patch)
tree665418d27a237f968f67e644e0d1529eefe06753 /bin
parent05c9fd0e649d197ac30de63271180065443769a8 (diff)
downloaddotfiles-1a6b4c5e12407271b55f620ba4cf5c5eeedc1f31.tar.bz2
dotfiles-1a6b4c5e12407271b55f620ba4cf5c5eeedc1f31.tar.xz
dotfiles-1a6b4c5e12407271b55f620ba4cf5c5eeedc1f31.zip
Add remarkable script
Diffstat (limited to 'bin')
-rwxr-xr-xbin/add-to-remarkable.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/bin/add-to-remarkable.sh b/bin/add-to-remarkable.sh
new file mode 100755
index 0000000..5fae218
--- /dev/null
+++ b/bin/add-to-remarkable.sh
@@ -0,0 +1,59 @@
1#!/bin/bash
2
3if [ ! -f "$1" ]; then
4 echo "usage: $0 file.pdf title"
5 exit 1
6fi
7
8if [ -z "$2" ]; then
9 echo "usage: $0 file.pdf title"
10fi
11
12file="$1"
13title="$2"
14uuid=$(uuidgen)
15tmpfolder=$(mktemp -d)
16
17trap "rm -rf ${tmpfolder}" EXIT
18
19cat > "${tmpfolder}/${uuid}".metadata <<METADATA
20{
21 "parent": "",
22 "type": "DocumentType",
23 "visibleName": "$title"
24}
25METADATA
26
27cat > "${tmpfolder}/${uuid}".content <<CONTENT
28{
29 "extraMetadata": {
30 "LastColor": "Black",
31 "LastTool": "Highlighter",
32 "ThicknessScale": "1"
33 },
34 "fileType": "pdf",
35 "fontName": "",
36 "lastOpenedPage": 0,
37 "lineHeight": 0,
38 "margins": 0,
39 "pageCount": 1,
40 "textScale": 0,
41 "transform": {
42 "m11": 1,
43 "m12": 1,
44 "m13": 1,
45 "m21": 1,
46 "m22": 1,
47 "m23": 1,
48 "m31": 1,
49 "m32": 1,
50 "m33": 1
51 }
52}
53CONTENT
54
55cp "${file}" "${tmpfolder}/${uuid}".pdf
56
57scp "${tmpfolder}/${uuid}".* root@10.11.99.1:.local/share/remarkable/xochitl/
58ssh root@10.11.99.1 systemctl restart xochitl
59