← All docs

Kindle

A jailbroken Kindle with USBNetwork or KUAL can run Still from a shell script: fetch image.png, hand it straight to eips (the Kindle's framebuffer tool, which can draw a PNG directly), sleep for however long the server says, repeat.

#!/bin/sh
URL="https://still.example.com/d/YOUR-TOKEN/image.png"
IMG=/mnt/us/still/image.png
HEADERS=/mnt/us/still/headers.txt
ETAG=""

while true; do
  if [ -n "$ETAG" ]; then
    STATUS=$(curl -s -o "$IMG" -D "$HEADERS" -w "%{http_code}" -H "If-None-Match: $ETAG" "$URL")
  else
    STATUS=$(curl -s -o "$IMG" -D "$HEADERS" -w "%{http_code}" "$URL")
  fi

  if [ "$STATUS" = "200" ]; then
    eips -g "$IMG"
    ETAG=$(grep -i '^ETag:' "$HEADERS" | sed 's/^[Ee][Tt]ag: *//; s/\r$//')
  fi

  SLEEP=$(grep -i '^X-Still-Sleep:' "$HEADERS" | sed 's/^[Xx]-[Ss]till-[Ss]leep: *//; s/\r$//')
  case "$SLEEP" in
    ''|*[!0-9]*) SLEEP=60 ;;
  esac

  sleep "$SLEEP"
done

Replace YOUR-TOKEN with your screen's token from its device URL, put the script somewhere under /mnt/us, and run it from KUAL or an init script. It never draws on a 304 or a network error, matching the device contract: the Kindle keeps showing whatever it already had.