Creating your own Obsidian iOS Widget

Do you see the special widget?

Feature Overview

First, lets outline what this widget can do. The widget can be configured to display information from your Obsidian vault for one of the following types of information:

  • List of all starred files (my personal favorite)
  • List of recently edited files
  • List of files from a specific folder
  • Display the text of a file from your vault.
All widget types and sizes

Installation

First you need to install on your iOS device a free program called Scriptable from the App Store. You can do this either on an iPad or iPhone, your choice!

Scriptable application from the Apple App Store
Click the + button to create a new script
Tap the title to rename the script
  1. We installed the free app Scriptable from the Apple App Store
  2. We created a new script in Scriptable
  3. We renamed the script to Obsidian Widget
  4. We pasted into this script the code we copied from the Github page

Bookmark your Obsidian vault folder in Scriptable

Scriptable needs to know where your vault is located on the file system of your device.

Creating Your First Widget

Let us now place the Obsidian iOS widget on the screen.

  • Start by adding a widget to your screen as you normally would and select the Scriptable widget from the list of widgets.
  • Choose the size of widget you want, in this example we will choose the middle sized widget.
Settings for the Scriptable Widget
Scriptable widget displaying information from the Obsidian vault

More Ways to Configure Widgets

You notice that we typed in TestVault in the parameter of the widget. This tells the widget what vault to use. With some additional information in the parameter field, you can show different information.

Starred

To show all starred files from the vault, the parameter should look like this:

Folder

You can also display the files from a specific folder. The input parameter requires three elements:

  1. Name of the vault
  2. the term FOLDER — which tells the widget this will list contents of a folder
  3. the folder path

File

The last display type shows the contents of a file. The input parameter requires three elements:

  1. Name of the vault
  2. the term FILE — which tells the widget this will display the contents of a file
  3. the file path

One important caveat

One issue with iOS widget is that they are not intended to be constantly updating. iOS wants to conserve battery and processing power and since widgets in general have static information they are not intended to be updating every few second or minute.

Conclusion

We have seen that this widget can display four types of information:

  • Recent files used in your vault
  • Starred files in your vault
  • Files from a specific folder in your vault
  • The text contents of a file

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store