I had a lot of trouble figuring out how to do this so I figured it would be a good thing to post.

First of all, what is this called?

menubar.jpg

Is it the toolbar? The menubar? Trying finding the answer to something on google without being to identify one of the key terms can be taxing. Anyhow, whatever it is called (I’m going with menubar), it is controlled by the SystemUIServer process, that much I know. And what is shown up there depends on settings in multiple preference panes and applications. When it comes to preferences that you set in System Preferences.app, this information is stored in com.apple.systemuiserver.plist. You can see what is in that plist by typing defaults read com.apple.systemuiserver in Terminal.

Check the man page for defaults before you do any writing and be sure you understand what you are doing. (It probably wouldn’t hurt to make a backup of the plist as well (you whimp))

Using defaults write, we can set which items will appear in the menubar by editing com.apple.systemuiserver.plist. This could come in handy in any situation where you wanted to change between two different layouts of those items (using a script for example).

This command will wipe out your current defaults, and create an empty menubar.

defaults write com.apple.systemuiserver '{"menuExtras" = ();}'

This command will set the defaults so that only the clock and volume items show up in the menubar:

defaults write com.apple.systemuiserver '{"menuExtras" = ("/System/Library/CoreServices/Menu Extras/Clock.menu", "/System/Library/CoreServices/Menu Extras/Volume.menu");}'

Since you are only “writing” defaults with the above commands, you will need to re-launch the SystemUIServer process in order to see the change. Do this by typing killall SystemUIServer in Terminal.

I hope that you found this when you needed it without too much googling!

  1. Can you provide some more details on this?

  2. blatti

    Ahmed,

    I’ll be glad to provide more details. Do you have any specific questions?

Leave a Reply

Posted in Apple No Comments leaf