Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ Kindle stores the cover ads on the lock screen in a system folder called `.asset

It works on Linux, macOS and should work on other \*nix systems.

Use [`kindle-delete-ads-mac.sh`](./kindle-delete-ads-mac.sh) on macOS

## Why

Deleting the `.assets` folder will work, but is only a temporary fix. I would recommend using this script to purge your Kindle when necessary, and keeping your Kindle in airplane mode so that it doesn't try to fetch more ads. Usage of airplane mode should also extend your battery life.
Expand Down
17 changes: 14 additions & 3 deletions kindle-delete-ads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
# changelog
#
# 2025-01-18: macOS compatibility
# 2024-06-20: drop bashisms
# 2016-07-24: initial release

Expand All @@ -19,9 +20,19 @@ fi
if [ -n "$1" ]; then
kindleDevice="$1"
else
echo -n "Autodetecting Kindle device... "
kindleDevice=`blkid | grep Kindle | cut -f 1 -d ':'`
echo "done"
# expected mount point on mac - mounts automatically
kindleMount="/Volumes/Kindle"
if [ -d $kindleMount ]; then
echo "Autodetecting Kindle device... "
kindleDisk=`diskutil list | grep Kindle | awk '{print $5}'`
kindleDevice="/dev/$kindleDisk"
echo "Kindle device file is $kindleDevice"
else
echo -n "Autodetecting Kindle device... "
kindleDevice=`blkid | grep Kindle | cut -f 1 -d ':'`
echo "done"
fi

fi

echo "Kindle device file is $kindleDevice"
Expand Down