cri.dev about posts rss

Converting my Kindle to a digital photo frame

Published on

Recently I converted my old Kindle Paperwhite 3 (jailbroken) to a Tapo surveillance cam viewer.

It was fun, but I recently had the idea to make a better use for it.

Namely making an image carousel showing nice pics I took over the years.

Project overview

The idea is quite simple:

Create a file under /etc/init/image-carousel.conf with the following content:

start on started lab126_gui
stop on stopping lab126_gui
pre-start script
  test -x /mnt/us/image-carousel.sh || { stop; exit 1; }
end script
exec /mnt/us/image-carousel.sh

Next, you’ll need to create an executable script under /mnt/us/image-carousel.sh

#!/bin/sh

# prevent the screen from going to sleep and showing the screensaver
lipc-set-prop -i com.lab126.powerd preventScreenSaver 1

while true; do
  for image in /mnt/us/images/prepared/*.png; do
    echo "$image"
    if [[ -f "$image" ]]; then
      eips -c -f -g "$image"
    fi
    sleep 30
  done
done

Make it executable with chmod +x /mnt/us/image-carousel.sh

Prepare the images

If you want, you can prepare the images on your PC using ImageMagick, but I’m going to do that on the Kindle using ffmpeg

Create two folders

  • /mnt/us/images
  • /mnt/us/images/prepared

Here is a little helper script to convert the images on the Kindle, place it under /mnt/us/images/prepare.sh and make it executable

#!/bin/sh

for image in /mnt/us/images/*.png; do
  echo "preparing $image"
  if [[ -f "$image" ]]; then
    echo " -> /mnt/us/images/prepared/$(basename $image)"
    ffmpeg -y -i "$image" -f image2 \
    -pix_fmt gray \
    -vf "scale=1448:1072,transpose=1" \
    -vframes 1 \
    "/mnt/us/images/prepared/$(basename $image)"
  fi
done

This will place the prepared images in /mnt/us/images/prepared/ (the folder the image-carousel script uses)

Now, reboot your Kindle and when the boot process finished your images will cycle and change every 30s.

Here, have a slice of pizza 🍕