Showing and hiding icons on the OSX menu bar

Ever wanted to show or hide some icons on the OSX menu bar by a script? Well, I was when I wanted to enable the VPN-icon for all my users. It wasn’t easy to find, but it turns out there’s a plist for that.

    defaults write ~/Library/Preferences/com.apple.systemuiserver menuExtras -array \
    "/System/Library/CoreServices/Menu Extras/VPN.menu" \
    "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
    "/System/Library/CoreServices/Menu Extras/Volume.menu" \
    "/System/Library/CoreServices/Menu Extras/Clock.menu" \
    "/System/Library/CoreServices/Menu Extras/User.menu"

Adding or removing icons can be done by editing the array above. Additional icons can be found at /System/Library/CoreServices/Menu Extras. A logout is necessary or simply restart SystemUIServer.

comments powered by Disqus