1

In my menu bar, I'd like to hide TimeMachine, Volume, Battery, User, Clock and show just Bluetooth, and Airport.

I tried to customize it with an sh script:

for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
  defaults write "${domain}" dontAutoLoad -array \
    "/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
    "/System/Library/CoreServices/Menu Extras/Volume.menu" \
    "/System/Library/CoreServices/Menu Extras/Battery.menu" \
    "/System/Library/CoreServices/Menu Extras/User.menu" \
    "/System/Library/CoreServices/Menu Extras/Clock.menu"
done

defaults write com.apple.systemuiserver menuExtras -array \
  "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
  "/System/Library/CoreServices/Menu Extras/AirPort.menu"

Unfortunately, I wasn't able to make it work. I obviously killall SystemUIServer, logged out, rebooted.. No luck. Am I missing anything?

4
  • Is there a particular reason you're trying to do this from the command line? Command-dragging the icons off the menu bar works pretty well.
    – Spiff
    Commented Nov 30, 2016 at 19:24
  • @Spiff It's part of a dotfile I'm working on.
    – Luke
    Commented Nov 30, 2016 at 20:51
  • dotfile as in a shell startup script? Are you saying you want to reset it this way every time you start a shell session?
    – Spiff
    Commented Nov 30, 2016 at 21:07
  • @Spiff bootstrap of new machines only dotfiles.github.io
    – Luke
    Commented Nov 30, 2016 at 22:06

0

You must log in to answer this question.

Browse other questions tagged .