Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Small daemon to send documents to your Kindle and eject it every time it's connected
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
set -eou pipefail
SRC="$HOME/Calibre Library/Send to Kindle"
DST="/Volumes/Kindle/documents/Sent to Kindle"
test -e "$SRC"
test -e "$DST"
for file in $(find "$SRC" -mindepth 1); do
osascript -e 'display notification "'"Sending $(basename "$file")"'" with title "Send to Kindle"'
mv "$file" "$DST"
unset IFS
diskutil eject "$DST_DEVICE"
osascript -e 'display notification "Sync Finished" with title "Send to Kindle"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.