Skip to main content

What are Search Mods?

By default, Monarch features a powerful natural language calculator. It allows you to quickly perform useful calculations without needing access to the internet.
  • Simple math
  • Unit conversions
  • Convert currencies
  • Compare time between timezones
  • Get the weekday of a specific date
  • And much much more
Monarch takes up as little screen space as possible (though you can expand the calculator by pressing TAB). This is the fastest way to calculate things on Mac. But there are many things that Monarch doesn’t calculate. Different users care about different units of measurement. And many people type their phrases slightly different. This why Search Mods was created! Search Mods allow you to extend not just the functionality, but the seamless user experience of Monarch’s calculator to suit your needs.

Creating Search Mods

Creating Search Mods in Monarch is easy. You’ll want to have some familiarity with Regular Expressions, but you’ll definitely be able to create your own with no technical knowledge using LLMs and the following prompt:
I am using Monarch for Mac and I would like to create my own Search Mod to do [task here]. I want to make it so that when I type into Monarch "[phrase example]" (add more examples or variations as necessary), it will run a terminal command to give me [expected output or calculation].

Here is the documentation for what Search Mods are and how they work: https://manual.monarchlauncher.com/search-mods

Please give me the regex and the command to accomplish this and ensure that the regex is as performant as possible.

Example Search Mods

  • weather in a city
  • conversion with fictional currency
  • sluggify a string and copy to clipboard
  • overriding Monarch calculator
Here’s an example of using a Search Mod to add Tip Calculator functionality to Monarch.
  1. Open Monarch
  2. Search for Monarch Settings or press ⌘ + ,
  3. Go to Search Mods
  4. Click the ”+ Add Search Mod” button
For the Pattern, enter:
(?:(\d+)%?\s+)?tip\s+(\d+(?:\.\d+)?)
Now create a command, the function that runs against the Pattern above to give you a result:
echo "scale=2; $2 * $([ -n "$1" ] && echo "$1" || echo "15") / 100" | bc | xargs -I{} echo "{} ($([ -n "$1" ] && echo "$1" || echo "15")% tip)"
Done! Now you can open Monarch any time and type: Either “tip 25” and get “3.75 (15% tip)” as a result instantly, or put a custom percentage in front such as “33 tip 25” and get “8.25 (33% tip)”.

Overriding Monarch Calculator

All Search Mods you create and install take precedent over the built-in Monarch calculator. This allows you to align Monarch to your exact preferences. For example if you prefer for MB to GB conversion to be 1024 instead of the commonly used 1000, you can change this by creating your own Search Mod called “MB to GB”.

Installing Search Mods

Monarch lets you easily install Search Mods from trusted sources. Each Search Mod is a simple mod file of structured JSON.

Why are Search Mods so powerful?

Other launchers make you search for and install multiple third-party extensions, and then isolate each extension from the others, leaving you with a fragmented user experience. Users often try to navigate this design flaw by setting up keyboard shortcuts for each specific extension. Monarch respects keyboard shortcuts too much to inflict this UX on you. Compare these two workflows, the first in another launcher, the second in Monarch.Let’s say you’re someone who needs to calculate 3 different kinds of things:
  • Flight miles to points
  • Your APY & Yield
  • Your bed time
In an extensions-driven workflow, after installing 3 separate calculator extensions, you would:
  1. Open launcher
  2. Search for “Flight Miles Calculator”
  3. Calculate the flight miles in its own UI
  4. Navigate back to root
  5. Search for “Yield Calculator”
  6. Calculate yield in the yield UI
  7. Navigate back to root
  8. Search for “Bed Time Calculator”
  9. Calculate bed time in the bed time UI
With Search Mods in Monarch, you can directly extend Monarch’s root search functionality, creating the calculator that you want. The user experience now becomes:
  1. Open Monarch
  2. Type your flight miles
  3. Then type your yield or APY
  4. Then type your bed time
This is a fundamentally different user experience!