Update image on each appearance?

I’ve tried to find an answer to this question, but I’m having a hard time.

I have a list of image urls, and I’d like to display a random image from that list each time the app appears on the Tidbyt’s screen. This works each time I render and push the webp to my device, but would it work as a community app? Would it essentially render and push for each user every time their Tidbyt displays the app?

Here’s my code. Thanks for any help you can offer.

load("render.star", "render")
load("http.star", "http")
load("random.star", "random")

# List of image URLs

def main(config):
    # Select a random image URL from the list
    selected_url = IMAGE_URLS[random.number(0, len(IMAGE_URLS) - 1)]

    # Fetch the image from the URL
    response = http.get(selected_url)
    if response.status_code != 200:
        fail("Failed to fetch image: " + selected_url)

    # Create an image component
    image_component = render.Image(
        width=62,   # Adjust the width as needed
        height=30   # Adjust the height as needed

    # Create a Box component to center the image
    box_component = render.Box(
        padding=1,  # Optional padding around the image

    # Display the box with the centered image
    return render.Root(

# No additional schema needed unless you want user-configurable options

We don’t know exactly how often the script gets run on the tidbyt backend. But I would assume that the image gets displayed multiple times before the script gets run again. However, I saw that new hieroglyphics app was updating quite frequently. Try that one and see if it updates every cycle. If so then your app can probably do the same thing if in community. That said if you have a way to push yourself it might be better to just do that so you can maintain control of exactly how often it’s updated.

1 Like

Thanks for taking a look!
I downloaded and pushed a similar app (Random Peanuts Images) , and it behaved the same way: It would update each time I rendered and pushed, but after that the image would remain the same each time the app appeared in my rotation. It’s a shame that it’s not possible to test how this kind of app would actually behave in the wild, or maybe I’m missing something.

That’s because the app doesn’t run on the tidbyt, it just shows the rendered image. The app only actually gets executed during the render process. The image won’t change until you re-render.