summaryrefslogtreecommitdiff
path: root/bin/kindlenotes
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-08-09 09:12:29 -0700
committerSean Whitton <spwhitton@spwhitton.name>2015-08-09 09:12:29 -0700
commita3c4916dd63a6edf7dc4cedc9cd7681dc90a5c6c (patch)
treebf3ce7663fd7939e9614e20d63471f982e45be8c /bin/kindlenotes
parentd9528072d05e376833b56d3d94bdeadb17884851 (diff)
downloaddotfiles-a3c4916dd63a6edf7dc4cedc9cd7681dc90a5c6c.tar.gz
fix kindlenotes script for Jessie
Under Jessie my Kindle doesn't show up in the output of blkid(8) so I don't know how to make the script mount the Kindle itself. So let's do it manually in Thunar.
Diffstat (limited to 'bin/kindlenotes')
-rwxr-xr-xbin/kindlenotes21
1 files changed, 10 insertions, 11 deletions
diff --git a/bin/kindlenotes b/bin/kindlenotes
index a1d33e18..a7963236 100755
--- a/bin/kindlenotes
+++ b/bin/kindlenotes
@@ -1,27 +1,26 @@
#!/bin/bash
-MNT=/mnt/kindle
-DEST="$HOME/lib/Dropbox/Kindle notes"
+MNT=/media/swhitton/Kindle
+DEST="$HOME/tmp/Kindle notes"
-kindle=$(blkid | awk -F: '/Kindle/ { print $1; exit; }')
+# kindle=$(blkid | awk -F: '/Kindle/ { print $1; exit; }')
filename=$(date +kindle_%F_%H%M.txt)
group=$(groups | awk '{print $1}')
-sudo mkdir -p "$MNT"
mkdir -p "$DEST"
-sudo umount $kindle
-sudo mount $kindle $MNT
+# sudo umount $kindle
+# sudo mount -ouid=$(id -u) $kindle $MNT
if [ -e "$DEST/$filename" ]; then
echo >&2 ERROR: Won\'t clobber other Kindle notes
-elif sudo mv --no-clobber \
+elif mv --no-clobber \
"$MNT/documents/My Clippings.txt" \
"$DEST/$filename"; then
- sudo chown "$USER:$group" "$DEST/$filename"
+ #chown "$USER:$group" "$DEST/$filename"
# remove the supporting file only if the clippings were moved successfully
- sudo rm -rf "$MNT/documents/My Clippings.sdr"
+ rm -rf "$MNT/documents/My Clippings.sdr"
else
- echo >&2 ERROR: Couldn\'t move the clippings file
+ echo >&2 ERROR: Couldn\'t move the clippings file: maybe you need to mount \in Thunar
fi
-sudo umount $kindle
+# sudo umount $kindle