Octory as a Menu Bar item
We strongly suggest that you start by reading the Getting Started and Explore Octory before starting this tutorial as we will focus on creating a Menu Bar slide without doing a deep dive on each component.
In this tutorial, we will be using a Plist editor software to build our configuration. If you prefer using a code editor to create your XML file, this is completely possible. The final configuration in the XML format can be found at the end of this tutorial.
Moving Octory to the menu bar offers new possibilities to use the software on a day to day basis. We will see first that it can be useful to display relevant information to the user using placeholders, then how to use it to propose custom actions to the user.
Initial Setup
- Grab the blank plist from our Gitlab and place it to the /Library/Applications Support/Octory/ or /Library/Managed Preferences/.
- Rename it Octory.plist
We will now do some changes to properly launch Octory as a Menu Bar item. To do so we will mobify a few keys and add some more.
- Change the Window→OnScreen key value to MenuBar.
- Delete the Slide section.
- Create a new MenuBarSlide section as a dictionary.
- Add Containers and Components arrays the same way you would with a Slide.
You could also modify the size of the menu bar slide with the Window→MenuBarSize key.
You should have a result similar to the following picture.
If you launch Octory now, you will see a new menu bar items with Octory's logo. If you click on it you can see a blank slide.
Add components
We will add a simple slide to start: one Text component with two Spacers to center it.
The Text component has been customized with a TextFontConfiguration dictionary. It is optional.
Display relevant information to the user
When an end-user contacts the support to find some help, it might be useful for them to find all relevant information in one place. For example, it is possible to display the Mac serial number but also more specific values like the Mac asset-tag if one is set. If we can use Octory placeholders to display the Mac serial number, retrieving the asset tag would be done by executing a command.
Let’s add those placeholders.
To edit Octory when it is on the Menu bar, it might be painful to have to click on the menu bar icon to reload the interface or see the changes. To make your workflow easier, you might want to add the key Admin→IsMenuBarSemiTransient
and set its value to true
. Thus, the window will not disappear when you click outside of its bounds, which is easier if you have to move the to configuration file often to edit it. When you want to hide the window on the menu bar, right click on the menu bar icon.
Device serial number
Add a new Text
component to the Components
array in the MenuBarSlide. This component will display the device serial number using a placeholder.
Execute a support command PRO
As we are talking about support, let’s now add a small useful feature to let your users contact the support by email. This will be done with an ExecuteCommand
command action which opens a link: mailto:support@acme.com
To execute this command, let’s add a Button
component with an ActionSet
. This is done by specifying the OnClick
key, which is a single ActionSet
. The button should be added at the bottom.
Final result
Here is the complete plist file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Admin</key>
<dict>
<key>IsAdminModeEnabled</key>
<true/>
</dict>
<key>MenuBarSlide</key>
<dict>
<key>Containers</key>
<array>
<dict>
<key>Components</key>
<array>
<dict>
<key>Type</key>
<string>Spacer</string>
</dict>
<dict>
<key>Type</key>
<string>Text</string>
<key>Text</key>
<string>Help</string>
<key>TextFontConfiguration</key>
<dict>
<key>TextAlignment</key>
<string>Center</string>
<key>Size</key>
<integer>60</integer>
<key>SystemFontWeight</key>
<string>Bold</string>
</dict>
</dict>
<dict>
<key>Type</key>
<string>Text</string>
<key>Text</key>
<string>Mac serial number</string>
<key>TextFontConfiguration</key>
<dict>
<key>TextAlignment</key>
<string>Center</string>
<key>SystemFontWeight</key>
<string>Bold</string>
</dict>
</dict>
<dict>
<key>Type</key>
<string>Text</string>
<key>Text</key>
<string>${DEVICE_SERIAL_NUMBER}</string>
<key>TextFontConfiguration</key>
<dict>
<key>TextAlignment</key>
<string>Center</string>
</dict>
</dict>
<dict>
<key>Type</key>
<string>Button</string>
<key>Text</key>
<string>Contact Support</string>
<key>Alignment</key>
<string>Center</string>
<key>Style</key>
<string>Simple</string>
<key>OnClick</key>
<dict>
<key>Type</key>
<string>Parallel</string>
<key>Actions</key>
<array>
<dict>
<key>Type</key>
<string>ExecuteCommand</string>
<key>Command</key>
<string>open mailto:support@acme.com</string>
</dict>
</array>
</dict>
</dict>
<dict>
<key>Type</key>
<string>Spacer</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>Window</key>
<dict>
<key>OnScreen</key>
<string>MenuBar</string>
</dict>
</dict>
</plist>