Behind the scenes at TRMNL it takes a little bit of magic to turn useful information into a beautiful graphic on your device.
But TRMNL users don't need to worry about any of that. You can build custom plugins with just a little bit of HTML and an HTTP request.
Since HTML and HTTP basically run the entire internet, this makes Apple Shortcuts a viable and free candidate for creating todo lists, weather tickers, and more, directly from an Apple Device.
Without setting up a web server you can generate new plugins with dynamic data, automatically from your iPhone, iPad, or Mac computer.
Step 1 - Create a Private Plugin
Inside TRMNL, navigate to Plugins and search for Private Plugin. This requires our Developer edition upgrade, which is just a 1 time fee of $20 from usetrmnl.com/upgrade.
Provide a name for your plugin, then select the Webhook strategy, then hit Save.
Step 2 - Get the Template
A TRMNL community member created this public template to help you get started:
โhttps://www.icloud.com/shortcuts/69e47acc278140379e7da8c32a147210
If you click the link above from an iOS device, you'll see a setup screen like this:
Click "Set Up Shortcut," then you'll land on a screen like this:
In this blank text box, copy / paste your Private Plugin's UUID from inside your TRMNL account. This will not appear until you click Save (the end of Step 1 above).
(Tip: if you're using an Apple computer to create the plugin, and your iPhone or iPad to create the Shortcut, then you can likely "copy" on your computer, then "paste" on your device, to avoid manually inputting this long string of characters)
Click "Add Shortcut" to finish adding the Shortcut template to your Apple device.
You may now view it from your Shortcuts dashboard and begin building custom logic.
Step 3 - Add functionality
Open your "TRMNL Starter Template" Shortcut on your Apple device by clicking the 3 dots in the top right corner of the widget. Optionally rename it by clicking the down arrow along the top of your screen.
In this tutorial we'll build a plugin that showcases random facts about dogs. The final result will look something like this:
In the bottom search bar, type "Get contents of" and select the "Get contents of URL" option.
This Shortcut step will be added to the bottom of your template. Hold it down with your finger or mouse and drag it up above the empty Dictionary step.
Click the placeholder "Url" icon, then "Clear variable," then input the following:
https://dog-api.kinduff.com/api/facts
Your Shortcut should now look like this:
If you click the play button on the bottom of your screen, Apple may ask you to approve access to open Chrome or another web browser. Select Yes.
You might see a new area populate with data, which in our case will be a random dog fact.
In our example above, Apple Shortcuts recommends a "next action" called Get Dictionary Value. Select this, or search for it in the bottom search bar if it does not automatically appear.
After adding a "Get Dictionary Value" step and dragging it below your "Get contents of" step added previously, change the step description to "Get Value for facts in Contents of URL."
Click the play icon again, and your screen should look like this:
Here we simply eliminated all the extra API data from the free Dog Facts tool, making a simple string of text that TRMNL can merge into a plugin design.
As a final step, input "dog_fact" in the 'key' field of our previously empty Dictionary step. Then in the 'value' field on the right, select Dictionary Value from the list of available variables.
And that's it! Clicking the play button should now:
fetch a random dog fact
assign it to a variable called
dog_fact
nest the
dog_fact
value insidemerge_variables
(generated by the starter template)send the
merge_variables
content to your TRMNL private plugin
Here are the results of clicking the play button after following all the steps above:
If your Shortcut isn't working as expected, here is another Shortcut template with all of the steps above completed. You will just need to provide your Plugin UUID to connect it to your account, which is explained above in Step 2.
Step 4 - Design your plugin
Back inside your TRMNL account, click the "Edit Markup" button at the top of your private plugin's settings screen.
Copy/paste the content below into the "Full" tab code editor, which should be pre-selected:
<div class="layout layout--center">
<div class="layout layout--col">
<div class="b-h-gray-1">Did you know?</div>
{% if dog_fact.size < 300 %}
<p class="value">{{dog_fact}}</p>
{% else %}
<p class="value--small">{{dog_fact}}</p>
{% endif %}
</div>
</div>
<div class="title_bar">
<img class="image" src="https://img.icons8.com/dog" />
<span class="title">Dog Facts</span>
</div>
Notice the use of {{ dog_fact }}
, this is how we merge in our data from the Dog Facts API.
Next, return to the Shortcut you created on your Apple device. Click the play button. A dog fact will be fetched + sent to TRMNL.
Finally, inside TRMNL go back to your plugin settings screen from the link near the top:
Click Force Refresh, then wait a few seconds.
Refresh the web page in your browser and you should see a random dog fact:
Step 5 - Automate new plugin content
Once you're happy with your Shortcut, head over to the Automation tab on your Shortcuts app.
โ
Select "New Automation", then choose some logic for how often the automation should be executed. For example, youcould choose "Time of Day" and select "Daily", "10a."
Select your "Dog Facts" Shortcut from the My Shortcuts section:
And you're done! A new dog fact will be generated on your TRMNL device every day at 10a. If you want more dog facts, just duplicate the automation at different times throughout the day.
Step 5 - Build more plugins
Phew! That was quite the process. Apple Shortcuts can be tricky at first, but once you get the hang of it, ~anything is possible.
For example, here is a custom Todo List plugin created by another TRMNL user:
How it works:
open plugin from the iPhone's home page
input a todo item
send it to TRMNL
display on device
Pretty cool, huh? We can't wait to see what you build.
Stay focused.