PipDecks Iphone Widget

| 3 min read

I started using Readwise a few months ago. The app allows you to highlight articles or books you read and aims to help memory retention by resurfacing content regularly. One way to do this is by displaying a widget on your phone screen. I installed the Readwise widget on my iPhone and found the idea to be brilliant. It could be part of the solution for me reading articles on the same topic repeatedly.

I wondered what other content I could display on widgets. My first choice was to randomly display a note from my Obsidian vault. I decided to try it using Scriptable, an iOS automation app that uses Javascript. However, I needed markdown parsing and I had no idea how to easily accomplish it. This led me to another idea.

I had purchased some PipDecks (this is an affiliate link) in the past, and very recently with the addition of the new Strategy Deck, it gave me an idea. Would it be possible to display a random card in a widget? The goal here is the same as with Readwise: resurface content, remember it, and make new connections.

Using Scriptable, I created, with the help of ChatGPT, a script displaying the front of a card, and when clicked, it would take you to the back of the card image inside the iPhone’s file manager. I encountered a problem where my widget had an ugly white background, but after some googling, I discovered that Maxwell Zeryck created a base Scriptable script to create a transparent background widget. After merging my script with Maxwell’s code, voilà!

Here’s how the widget looks and works:

The widget in action

How to Install

If you want to install this widget on your phone, you can download the script. The code may not be perfect, but it gets the job done.

  1. Create a directory where it makes sense to you in the File app on your iPhone.
  2. Download your PipDecks cards from PipDecks Vault.
  3. Copy some PipDecks cards into that directory. You need both the front and back of all cards, and all cards must be directly within that directory. You must remove every intermediate directory (see bonus below).
  4. Install Scriptable, if you haven’t already.
  5. In the Scriptable configuration, create a bookmark named "PipDecks" pointing to the directory containing the cards. Don’t change that name, it’s hardcoded in the script.
  6. Create a new Scriptable script. Pick a name you like. "PipDecks Card Widget" is a good one.
  7. Copy my script and paste it inside the Scriptable editor and save.
  8. Create a screen capture of your iPhone on an empty Home Screen Page. We will use this to generate the widget background.
  9. Go back to Scriptable, run the script. It will ask you to provide the screen capture you just took, and to select if you want to place your widget at the top or the bottom of the screen.
  10. Add a new widget on one of your Home Screen Pages and select the script you’ve just created.
  11. Enjoy!

Do you speak French and want to stop hating your tests ?

I've created a course to help developers to improve their automated tests.

I share ideas and technics to improve slow, flaky, failing for unexpected reason and hard to understand tests until they become tests we take joy to work with !

But you'll need to understand French...

Bonus: Installing Decks with a Directory per Card

When you download cards from PipDecks Vaults, you’ll notice that some decks are organized differently from others. Some have all cards in the same directory (which is what we want) and others have a sub-directory for each card. Instead of undergoing the manual and tedious task of going inside each card directory to copy the front and back images to the bookmarked "PipDecks" directory, I created an iPhone shortcut which prompts for an origin directory, loops through all cards directories, and moves the images to the bookmarked directory. It’s much easier.

If you prefer a simpler approach, you can download the shortcut.

I hope you’ll enjoy the widget and that it will help you remember all the great ideas from your PipDecks.