Step 1: Install MenuBarTriggerh
Step 2: Install the icon files locally on your test Mac. The ones used in this example (and referenced in the script) can be installed using MenuBarTrigger Example Icon Files pkg
Note: The script also makes reference to a progress wheel gif file – for the gif to animate it needs to be hosted online, so my example script points to a hosted version.
Step 3: Run the script below. You can run it as a policy payload or just locally from your test Mac. The function create_webviews creates the 11 HTML files that will be presented in the pop-over. This is followed by the actual MenuBarTrigger call, which stipulates which command to run with which webview, the dimensions of the pop-up, and the icon to show on the menubar.
The example script only uses the ‘sleep 5’ command, but you would replace this command with the actual Jamf Pro or bash commands that you want to run at each step. For example:
/usr/local/MenuBarTrigger.app/Contents/MacOS/MenuBarTrigger --file /var/tmp/1.html "policy -trigger outlook" \
--file /var/tmp/2.html "policy -trigger slack --icon /var/tmp/images/apple2.png" \
--file /var/tmp/3.html "policy -trigger chrome --icon /var/tmp/images/apple3.png" \
--file /var/tmp/4.html "policy -trigger word --icon /var/tmp/images/apple4.png" \
--file /var/tmp/5.html "policy -trigger powerpoint --icon /var/tmp/images/apple5.png" \
--file /var/tmp/6.html "policy -trigger excel --icon /var/tmp/images/apple6.png" \
--file /var/tmp/7.html "policy -trigger onenote --icon /var/tmp/images/apple7.png" \
--file /var/tmp/8.html "policy -trigger onedrive --icon /var/tmp/images/apple8.png" \
--file /var/tmp/9.html "policy -trigger skype --icon /var/tmp/images/apple9.png" \
--file /var/tmp/10.html "policy -trigger zoom --icon /var/tmp/images/apple10.png" \
--file /var/tmp/11.html "wait --icon /var/tmp/images/apple11.png" \
--width 270 --height 190 --icon /var/tmp/images/apple1.png
The last webview uses a ‘wait’ command, which means that the menubar item stays there until a button is clicked within the webview. In this case it is a “Reboot” button, but there is no subsequent reboot action carried out in our example script.