### KUAL Menu Definition (JSON) Source: https://context7.com/usetrmnl/trmnl-kindle/llms.txt Defines the structure of the KUAL menu for the TRMNL extension. It creates a 'TRMNL' submenu with an option to 'Start TRMNL', which executes the main shell script. ```json { "items": [ { "name": "TRMNL", "priority": -10, "items": [ { "name": "Start TRMNL", "priority": 100, "action": "./TRMNL.sh" } ] } ] } ``` -------------------------------- ### Image Download and Display (Bash) Source: https://context7.com/usetrmnl/trmnl-kindle/llms.txt Downloads a PNG image from a given URL and displays it on the Kindle's e-ink screen using the `eips` command. It parses the image URL and refresh rate from the API response, downloads the image to a temporary directory, clears the screen, and then renders the image at specified coordinates. Includes a sleep interval based on the refresh rate. ```bash # Parse image URL and refresh rate from JSON response IMAGE_URL=$(echo "$RESPONSE" | sed -n 's/.*"image_url":"\([^" ``` -------------------------------- ### TRMNL API Integration (Bash) Source: https://context7.com/usetrmnl/trmnl-kindle/llms.txt Fetches dashboard content from the TRMNL API. It includes API key, base URL, user agent, and sends device-specific information like battery voltage, screen dimensions, RSSI, and MAC address in HTTP headers. It expects a JSON response containing image URL and refresh rate. ```bash # API Configuration API_KEY=$(cat apikey.txt) BASE_URL="https://trmnl.app" USER_AGENT="trmnl-display/0.1.1" # Fetch JSON metadata from TRMNL API BATTERY_VOLTAGE=$(get_kindle_battery) RESPONSE="$( curl -s \ -H "access-token: $API_KEY" \ -H "battery-voltage: $BATTERY_VOLTAGE" \ -H "png-width: $PNG_WIDTH" \ -H "png-height: $PNG_HEIGHT" \ -H "rssi: $RSSI" \ -H "ID: $MAC_ADDRESS" \ -A "$USER_AGENT" \ "${BASE_URL}/api/display" ) # Expected JSON response format: # { # "image_url": "https://example.com/dashboard.png", # "refresh_rate": 300, # "filename": "dashboard.png" # } ``` -------------------------------- ### KUAL Extension Metadata Configuration (XML) Source: https://context7.com/usetrmnl/trmnl-kindle/llms.txt Defines the metadata for the TRMNL KUAL extension, including its name, version, author, and ID. This XML file is essential for KUAL to recognize and load the extension. ```xml TRMNL 1.0 Marcus Schappi TRMNL menu.json ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.