chrisgrieser / shimmering-obsidian

Alfred Workflow with dozens of features for controlling your Obsidian vault.
https://alfred.app/workflows/chrisgrieser/shimmering-obsidian/
MIT License
817 stars 40 forks source link
alfred alfred-workflow obsidian-md

Shimmering Obsidian 🎩

Alfred workflow with dozens of features for controlling your Obsidian vault.

⭐ Featured in the Alfred Gallery.

Download count Last release

Promo Video

Table of Contents

Installation

This workflow requires Alfred 5 with Powerpack.

  1. Install the Obsidian plugins Advanced URI & Metadata Extractor. Enable both plugins.
  2. Download the latest release at GitHub. Double-click the .alfredworkflow file to install it.
  3. Set your vault path in the workflow configuration.
  4. Run the Alfred Command osetup. Obsidian then restarts.

Alfred-based quick switcher

The Alfred-based Quick Switcher is basically an enhanced version of Obsidian's Quick Switcher Core Plugin.

<img alt="promo video" width=70% src="https://user-images.githubusercontent.com/73286100/139678407-9ac39baa-5f49-42a0-9622-0fbaf68540b2.gif">

How the search works

All the search features listed here do not directly search your vault, but rather use the metadata created by the Metadata Extractor Plugin on a regular basis. By default, this happens every 30 minutes, meaning recently created notes, recently renamed notes, or recent tag changes are not picked up at once. You can change the metadata refresh rate via the Metadata Extractor Plugin's settings.

Main search

o: Open files in your vault. This keyword searches all your notes, aliases, folders, and headings combined.

Search for notes

This works similar to Obsidian's built-in Quick Switcher, but can be triggered without Obsidian running (in which case it opens Obsidian with the selected note). Press ⏎ to open the selected file in Obsidian.

[!TIP] There are various settings for appending and opening notes, which can be found in the workflow configuration.

Smart queries

Search for aliases

This command also looks for aliases, when they are defined in the YAML-Header.

Search for folders

When selecting a folder, you "browse" the selected folderβ€”this means that you are now searching only for files and folders inside that folder.

Search for headings

Displayed alongside the other search results are all headings in your vault. Selecting a heading with ⏎ opens the file at the respective heading.

[!TIP] Add more heading levels to h_lvl_ignore if your search results become too crowded.## Search for Headings Displayed alongside the other search results are all headings in your vault. Selecting a heading with ⏎ opens the file at the respective heading.

  • βŒƒ + ⏎: Copies either a Markdown link that uses the Obsidian URI or the wikilink to the selected file, depending on the setting. Also work with headings.
  • Add heading to your search query, to only display headings, for example, o foobar heading only displays headings that include foobar.
  • Add h1, h2, … to your search query, to only display headings of a certain level, for example, o obsidian h2 only displays level 2 headings that include obsidian.
  • You can ignore certain (or all) heading levels with the respective workflow configuration.

[!TIP] Add more heading levels to h_lvl_ignore if your search results become too crowded.

Browse links of a note

Use ⇧ + ⏎ on any search result of the main o search to browse the links of that note

Search notes by their tags

ot: Search tags and subsequently files with that tag

Search bookmarked files

ob: Search bookmarked Files and Searches

Search recent files

or: Open recent Files

Search for attachments

oa: attachments

Search all external links in the entire vault

oe: Search all external links in your entire vault

Extra features

Supercharged icons

You can prepend or append icons to the results of any search based on the notes' tags, similar to the Supercharged Links Plugin.

Example

coding,πŸ’»
person,πŸ‘€
seedling,,🌱
pkm,🧠,πŸ’‘

…results in:

πŸ’» Filename1
πŸ‘€ Filename2
Filename3 🌱
🧠 Filename4 πŸ’‘

Privacy mode

When the "Privacy Mode" checkbox is enabled, all notes with the cssclass private are censored when performing a search. This setting is meant to be enabled temporarily, for example during screen-sharing.

Vault search as Alfred fallback

The main search (o) can also be used as Fallback Search for Alfred, basically a search that shows up when any Alfred search has no result.

Previewing notes via QuickLook

To avoid accidentally triggering the Quick Look feature, it is suggested you turn off activating QuickLook via shift and use ⌘ + Y instead. You can do so with in the Alfred Settings under Features β†’ Previews:

QLmarkdown and Peek both enable previewing of Markdown documents. Peek works with a wide range of other file types than Markdown, but costs around €5. QLMarkdown is free, but only works for Markdown and requires some minor setup.

- The app `QLMarkdown.app` must be started at least once. You may need to right-click the app and select `open`, to be able to allow macOS to trust the app. - To enable proper display of YAML headers, you need to enable the respective setting in the Advanced Options of QLMarkdown: screenshot of QLMarkdown

Note-related features

Create a new note

on: Create a new note.

Scratchpad

oo or triggered via hotkey: Append to your Scratchpad Note

[!TIP] There are various settings for the scratchpad in the workflow configuration. You can, for instance, use Alfred's Dynamic Placeholders to prefix the current date and time.

Screenshot features

OCR Screenshot

OCR screenshots

Triggered via Hotkey: Take an OCR Screenshot.

Requirement
For the OCR-Screenshot Feature, you need to install Tesseract. If you use Homebrew, you can do so with the following command:

brew install tesseract tesseract-lang

[!TIP] The first time you use the OCR or image screenshot feature, you might need to give Alfred permission to record your screen. You can do so under the macOS system settings.

Permissions for OCR Screenshots

Image screenshot

Triggered via Hotkey: Take an image screenshot.

Utility features

Workspace switcher

ow: Switch to a different workspace

<img alt="workspace" width=60% src="https://user-images.githubusercontent.com/73286100/133615940-a56731e5-6b60-4d28-b877-7ea48d10225e.gif">

Vault switcher

ov: Open Vaults in Obsidian, Finder, or the Terminal

[!NOTE] The Metadata Extractor and the Advanced URI plugin need to be installed in every vault you want to control, and osetup needs to be run once.

Back up your vault

obackup: Create a backup of your vault.

tell application id "com.runningwithcrayons.Alfred"
    run trigger "backup-obsidian" in workflow
    "de.chris-grieser.shimmering-obsidian"
end tell
# pass 'no sound' as argument to turn off backup confirmation sound

[!WARNING] Please be aware that this is a simplistic backup solution. While I did not have any problems with it, this workflow comes without any warranties, as stated in the license. If you want 100% safety, please use a professional backup solution.

CSS files

ocss: Access your css files.

Open various folders

Update plugins & metadata

oupdate: Update Plugins and Metadata used by this workflow

Plugins, themes, and settings

Plugins

op: combined Search of community plugins and community themes.

Themes

op: Combined Search of community plugins and community themes.

<img alt="plugin search" width=60% src="https://user-images.githubusercontent.com/73286100/131027623-5e8b3667-d00d-47dc-ba49-6938686e2aca.gif">

Settings & local plugins

o,: Search and directly open specific setting tabs.[^1]

[!TIP] o, refers to the ⌘ , shortcut used to open the settings.

Documentation searches

Official documentation

**oh: Search the official Obsidian help (documentation)

odv: Search the dataview documentation.

Plugin developer documentation

odd: obsidian developer documentation Search

Search the official Obsidian developer docs.

Cheatsheet

Credits

About the developer

In my day job, I am a sociologist studying the social mechanisms underlying the digital economy. For my PhD project, I investigate the governance of the app economy and how software ecosystems manage the tension between innovation and compatibility. If you are interested in this subject, feel free to get in touch.

[!IMPORTANT] Note that for questions, bug reports, or feature requests for this workflow, please open a GitHub issue, since it is better suited for technical support.

<img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' />