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?

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!
I will eventually be creating a series of posts outlining how to create a OS X client based lab-environment. This series will feature outlines on making a consistent user experience, locking down the workstations, generating use logs, and forcing a Novell server login. I have recently been working on the latter, and wanted to share a few tidbits that have many uses beyond the scope decribed above.
Determining the IP address or hostname of an OS X client from the shell
This comes in handy for logging purposes. Lets say you have multiple machines that you want to keep track of in a single log. Hostname an/or IP are a great way to do this. To get a machines IP address(es) try this from the command line:
ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d -f2
To get the hostname (the piped sed command will remove the .local” suffix) try this from the command line:
hostname | sed 's/.local//'
Mounting an AFP volume from the shell
First you will need to make a folder to use as a mount point. I suggest using the standard location /Volumes/. Let’s say the remote volume is called “Backup”. To make the local mountpoint:
mkdir /Volumes/Backup
Now you will need to mount the remote volume to the local mount point. Let’s assume we want to include the username and password in the command so there is no further user interaction with the GUI. Lets also use an IP address of 192.168.0.1 to identify our remote server.
mount -t afp afp://username:password@192.168.0.1 /Backup /Volumes/Backup
Of course there are ways to make a secure mount without a password too. See my posting on creating and using ssh keys for more info.
Disabling the Dock and the Finder
This involves messing with the core of OS X, so I suggest you stay away from this unless you are comfortable with something like that.
First of all, OS X likes to keep the Dock and the Finder open at all times. Go ahead and killall Dock and you will see that the Dock just relaunches. However, if the Dock is not in the default location or has a different name, OS X won’t be able to relaunch it. Same goes for the Finder. So if you move those applications from wherever they are (wink wink) into the /Applications folder for example, when your computer starts up you will be running OS X sans Finder and Dock.
Now if you made your computer auto-login to an account that had only a Firefox.app startup item, you will have essentially made an internet kiosk. As you can imagine, the possibilities extend way beyond that. You could always open the Finder or the Dock by calling open /Applications/Finder.app or open /Applications/Dock.app using the shell.
Stay tuned to see how these items can be used in the lab environment!



