Show usage in the macOS menu bar
Beta: the menu bar plugin is beta, like crewrota on macOS. It has not yet been tested thoroughly by hand.
crewrota ships a SwiftBar and xbar plugin, crewrota.1m.sh, that shows the current member’s 5-hour use in the menu bar and every member’s use in its dropdown.
Install SwiftBar, copy the file from "$(npm root --global)/crewrota/widget/crewrota.1m.sh" into its plugin folder, and make it executable.
It runs crew quota --format menubar every minute, which only reads saved readings and never sends a message.
Install it
Section titled “Install it”Install SwiftBar (macOS 12 or newer) and open it once; it asks you to pick its plugin folder:
brew install swiftbarCopy the plugin into that folder and make it executable (here the folder is ~/SwiftBar):
cp "$(npm root --global)/crewrota/widget/crewrota.1m.sh" ~/SwiftBar/chmod +x ~/SwiftBar/crewrota.1m.shThe 1m in the file name tells SwiftBar and xbar to run it every minute.
xbar reads the same file from its own plugin folder.
What it shows
Section titled “What it shows”The menu bar shows crew and the current member’s 5-hour use, for example crew 30%.
Click it for each member’s 5-hour and week use with their reset times, green under 60%, amber from 60% and red from 80%, then Open the crew menu and Refresh.
The current member’s name is bold.
Open the crew menu opens a terminal running crew.
This is the text the plugin turns into the menu, from a demo crew:
crew quota --format menubarcrew 30%---main | font=Helvetica-Bold5h 30% resets 09:03 | color=#3fb68bweek 55% resets Wed 09:03 | color=#3fb68bside5h 30% resets 09:03 | color=#3fb68bweek 55% resets Wed 09:03 | color=#3fb68bteam5h 30% resets 09:03 | color=#3fb68bweek 55% resets Wed 09:03 | color=#3fb68b---The output goes on with two more lines, left out here because they hold the paths of the machine that made the sample: Open the crew menu | shell="<your node>" param1="<crewrota's cli.js>" terminal=true and Refresh | refresh=true.
Where the numbers come from
Section titled “Where the numbers come from”crew quota --format menubar reads each member’s saved quota.json and never checks usage itself, since it runs every minute.
The readings come from the crew menu, crew quota, a running session’s status line and crew warmup.
So the menu bar is only as fresh as your last reading; run crew quota to take new ones.
See Where usage readings come from.
If crew is not found
Section titled “If crew is not found”Menu bar apps start plugins with a short PATH.
The plugin adds /opt/homebrew/bin and /usr/local/bin, where Homebrew and npm usually put crew and node.
If crew is still not on that PATH, the menu bar shows crew with crew is not on PATH. Install crewrota, then refresh. in its dropdown.