close
close

Create a custom menu bar app for weather and home climate control with MenuBot and Shortcuts

Create a custom menu bar app for weather and home climate control with MenuBot and Shortcuts

Last year I wrote about how I was able to display my outdoor sensor’s temperature in my Mac’s menu bar using a combination of shortcuts, SF Symbols, and small utilities like One Thing and Data Jar. I’ve been using that approach ever since, but this summer I came across a tool that changed that: MenuBot.

MenuBot is an app for the Mac that lets you create your own displays and applets for your menu bar directly from the output of a shortcut. The app is more powerful than it might seem at first glance: you can create entire submenus and even bind URLs and actions to each menu item. I ended up using it to completely revamp my outdoor temperature display in the menu bar and even extend it with HomeKit controls.

I had a lot of fun playing with MenuBot. Let me show you what I did with it.

MenuBot is incredibly easy to set up. When you first launch the app, all you need to do is select one of the sample shortcuts provided and set a reload interval to decide how often your custom menu bar applet will be updated. By default, MenuBot has seven built-in sample shortcuts: Weather Overview, Chance of Rain, Events Today, Next Event, Web Links, Network Overview, and Shortcut Launcher. Each is pretty self-explanatory, and if you look at them, they’ll give you a rough idea of ​​what kind of menu bar applets you can create using MenuBot and shortcuts.

The built-in keyboard shortcuts are not only handy, but they’re also great examples for learning the syntax you’ll need to create your own keyboard shortcuts for MenuBot. This syntax lets you configure what appears directly in the menu bar item and what goes into the menu that opens when you click it.

This is what the output syntax for the MenuBot example shortcut “Weather Overview” looks like:

To add MenuBot functionality to a new or existing shortcut, insert a text block with the formatted data used by the app to create your menu bar applet, and set that text block as the shortcut output. The syntax works as follows:

  • The first line of output is displayed directly in the menu bar. Each subsequent line is displayed in a menu.
  • Insert ---on a new line to add a separator to the menu.
  • Insert > at the beginning of a line to add a submenu item.
  • Add a URL at the end of a line to convert the menu item into a link. This works with both web URLs and app URL schemes.
    • For example, add https://macstories.net at the end of a line to open MacStories when you click the menu item, or weather:// to open Apple’s native Weather app on macOS.
    • This can also be used to perform other links with this URL scheme: shortcuts://run-shortcut?name=(name of your shortcut)
  • Optionally, add the name of an SF icon at the beginning of each line. MenuBot automatically renders SF icons in the menu bar and submenus. Example: cloud.fill is displayed as a filled cloud symbol.

With this information, I knew it would be very easy to customize my old menu bar shortcut.

Most of the basics of my shortcut remained the same. I still use the temperature and humidity data from the Eve weather station mounted outside my bedroom window via HomeKit, and assign SF icons based on current weather conditions. Additionally, I still use Data Jar and a mathematical formula to calculate whether the recorded temperature is trending up or down over the past hour, and display an indicator accordingly. (Read my previous story to learn more about this setup.)

However, since MenuBot can create entire menus and submenus, I was able to add more functionality to my shortcut. For my custom menu bar applet, I had two ideas in particular in mind:

  1. Add the ability to compare my outdoor sensor’s weather data at a glance with the forecast from Carrot Weather (which conveniently supports Météo France, France’s national weather service, as a source).
  2. Add the ability to quickly turn the air conditioner, air purifier and fans in my home on and off directly from the same menu.

While the former was straightforward and mostly consisted of putting together a menu that collected weather variables and SF icons, the latter presented a bit of a challenge. After setting up a shortcut to toggle my bedroom fan (I called it “VentilateurON”), I added a line “Toggle bedroom fan” to my MenuBot shortcut output and ended it with the URL scheme for running the bedroom fan shortcut. It looked like this:

fan Toggle Bedroom Fan shortcuts://run-shortcut?name=VentilateurON

However, this method had a drawback. Running the shortcut URL scheme always opens the Shortcuts app on the Mac. As a way to quickly turn on the bedroom fan from the menu bar while I was working on something, this was too distracting and meant I had to manually close the Shortcuts app each time.

But again, BetterTouchTool came into play and saved the situation. The app can run shortcuts completely in the background, without the need to open any windows in your workspace. And even better, BetterTouchTool also provides a fully functional URL scheme that can be used in MenuBot.

To take advantage of this, I created a “named trigger” (also called “VentilateurON”) in BetterTouchTool that starts the shortcut to the bedroom fan.

Then in the MenuBot shortcut output, I changed the line to use BetterTouchTool’s URL scheme instead of shortcuts and ended it with BetterTouchTool’s named trigger:

fan Toggle Bedroom Fan btt://trigger_named/?trigger_name=VentilateurON

Now when I click “Toggle Bedroom Fan” in my custom menu bar applet, the shortcut runs to turn the bedroom fan on and off via BetterTouchTool completely in the background, without opening any annoying windows.

I repeated this process for each of the HomeKit HVAC units in my house, even going so far as to add “when” conditions to detect and display in the menu whether my fans, air purifiers, and air conditioners are currently on or off. In addition, I added dynamic indicators to the first line of the Shortcut output to display specific SF icons in the menu bar when rain is forecast or the air quality is poor. To do this, I was able to access Air Grenoble, an app with Shortcuts support that was specifically designed to monitor air quality in my home region of Grenoble, France.

The resulting custom menu bar applet is extremely tailored to my needs and my home. From top to bottom, it displays temperature and humidity data from my outdoor sensor, living room, and master bedroom, and the fourth and final section contains a summary of the weather forecast from Carrot Weather. Each room section has controls to toggle air purifiers, fans, and air conditioners—each accompanied by an SF icon to indicate their current status.

This is what it looks like:

I couldn’t be happier with this result. It’s the culmination of so many independent apps and utilities working together to create a hyper-specific applet for the Mac menu bar. With a single click in the menu bar, I can quickly glance at the forecasted weather conditions, compare them to the actual readings from my outdoor weather sensor, see how warm or cold it is in each of my main rooms, and even directly switch each of my HVAC units accordingly. All of this is a combination of Shortcuts, HomeKit, Data Jar, Carrot Weather, Air Grenoble, BetterTouchTool, and MenuBot, and that’s exactly why it’s so perfect.

I have one more wish for you. If you read this and feel inspired to use MenuBot in combination with other utilities to create your own custom menu bar applets, please don’t hesitate to share them with me on Mastodon or the Club MacStories Discord server. I’m excited to see what you come up with.


As you can see, my custom shortcut for MenuBot is tailored specifically to my needs, location, and accessories, but if you’d like to take a look for inspiration, you can download it here.

MenuBot can be purchased from the Mac App Store for $3.99.

Leave a Reply

Your email address will not be published. Required fields are marked *