https://github.com/avindra/kindle-delete-ads
:black_square_button: :name_badge:Save some disk space and your eyeballs.
https://github.com/avindra/kindle-delete-ads
kindle linux paperwhite udev
Last synced: about 1 year ago
JSON representation
:black_square_button: :name_badge:Save some disk space and your eyeballs.
- Host: GitHub
- URL: https://github.com/avindra/kindle-delete-ads
- Owner: avindra
- Created: 2016-07-24T19:49:21.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2025-01-25T21:45:35.000Z (over 1 year ago)
- Last Synced: 2025-04-14T14:14:27.162Z (about 1 year ago)
- Topics: kindle, linux, paperwhite, udev
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kindle-delete-ads
## Installation
The recommended installation is to your local `bin` folder (it should be in your `$PATH` by default).
```bash
wget -P ~/bin https://raw.githubusercontent.com/avindra/kindle-delete-ads/main/kindle-delete-ads.sh
chmod +x ~/bin/kindle-delete-ads.sh
```
## Usage
```bash
$ sudo kindle-delete-ads.sh
Kindle device file is /dev/sde1
Mounting Kindle to temporary location: /tmp/tmp.jIUXPogGgC
Ads detected. Cleaning time.
Deleting all ads... done
Installing temp ad blocker... done
Unmounting kindle... done
# Will do nothing if ad blocker is in place
$ sudo kindle-delete-ads.sh
Kindle device file is /dev/sde1
Mounting Kindle to temporary location: /tmp/tmp.q1jNYEkwex
Temp ad blocker is still intact! Nothing to do.
Unmounting kindle... done
```
## How
Kindle stores the cover ads on the lock screen in a system folder called `.assets`. This is a script which automates the well known hack.
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.
# Autorun on plug in
To make life as easy as possible, have your computer wipe the Kindles ads every time you plug it in.
Unfortunately [since June 2018, udevd service has been restricted to a limited set of syscalls](https://github.com/systemd/systemd/commit/ee8f26180d01e3ddd4e5f20b03b81e5e737657ae#r143372255), notably missing `@mount`. To work around this, add `@mount` to `SystemCallFilter` in `/usr/lib/systemd/system/systemd-udevd.service`, or simply comment out the entire `SystemCallFilter` line.
Afterwards, add a file to `/etc/udev/rules.d` called `99-kindle.rules`.
```sh
ACTION=="add", ENV{DEVTYPE}=="partition", ATTRS{idVendor}=="1949", ATTRS{idProduct}=="0004", RUN+="/home/avindra/bin/kindle-delete-ads.sh '%E{DEVNAME}'"
```
*NOTE*: Your `idProduct` will probably differ, depending on the Kindle model you have. Additionally, be sure to set the script path in `RUN` to the location where you have installed this script.