In my case, I have a netlify.1m.js file in my BitBar scripts folder (the 1m in the filename tells bitbar how often to refresh my script, in this case every 1 minute). Those scripts get turned into individual menu bar apps. Once installed, you’ll get a directory where you can put individual scripts (of all kinds might I add, like PHP, JavaScript, Ruby, Go, etc). Here’s how it works.įirst you have to install BitBar on your Mac. “Netlify has an API” I thought, “I bet I could write a node script that talked to Netlify and translated the response to something BitBar expects in order to render a menu bar app!” A little while later and I had exactly what I wanted. ![]() “There’s got to be a way to write JavaScript for OS X” I thought, “like an Electron app but for the Mac’s menubar.” Then I found BitBar: an app that let’s you “put the output from any script or program in your Mac OS X Menu Bar”. But I just didn’t have the time for that. So how does all of this work exactly? Good question.īecause I wanted a native menu bar app for my Netlify sites, I thought for a second about jumping into Xcode. If you wanted, you have each site be its own flyout menu in the menu bar and have it display all kinds of meta info-build status, build time, site url, netlify site admin url, etc-you could! The sky’s the limit. What’s really neat about is how flexible BitBar actually is. So putting it all together, you get something like this: Gray: no build pipeline applicable (for me, these were static sites I dragged and dropped for deployment through Netlify’s UI)Ĭlicking on any of the sites listed in the dropdown will take you to that particular site in Netlify.When I click on the menu bar app, I get a native dropdown which displays all my sites (I decided to group them by domain) along with a little status light indicator to show the build status: If there’s a build in progress (or one failed), I get a number next to the menu bar icon, a kind of notification if you will. Each time it runs, it asks Netlify for all my sites and the latest build status of each. ![]() What’s neat is BitBar has instructions on how to build your menu bar app so it accommodates things like retina screens and dark mode.īitBar also has a very simple API for indicating how often your script should run: via the file name! I set mine to run every minute (but I could make it every 30, 15, or 5 seconds if I wanted). So what does it look like?īy default you get a nice little Netlify logo in your menu bar. ![]() A Netlify Menu Bar App for Macįirst of all, it’s worth noting that I built this on top of BitBar. If you’re a Mac user, what if you had a menu bar app that could show you similar information? Namely, what’s the status of the latest build for my sites on Netlify? Well I tried to make something a little different. ![]() Not only can you checkout a live demo of the project, but you can also read/view/fork the code behind it to get your own dashboard! So why try and make anything better than that? It was cool to see somebody else execute on it so beautifully. Similar to Phil, a tool of some sort showing the build status of all my sites on Netlify was a fun project idea I’d had in the back of my mind for a couple months. I've been meaning to make my own dashboard showing the status any of my sites that I care about by just including a list of deploy badges.īut beat me to it with this nice example. And I build on it quite a lot.Ī while back, I was scrolling through my twitter feed and saw this project tweeted about by Phil Hawksworth: In case you don’t already know, I like Netlify.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |