Display computer name in menu bar?

ts85
New Contributor III

Anyone know of a way to show the Computer Name from Sys Prefs > Sharing in the menu bar? We have a lot of edit suites and this would be handy when assisting users.

1 ACCEPTED SOLUTION

marktaylor
Contributor

We use the 'click on the clock' feature at the login screen to reveal hostname, IP address, OS version and build. This saves logging into the computer to find this information. It doesn't help once a user is logged on but I thought I'd throw it in the pot!
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName

View solution in original post

8 REPLIES 8

tkessler
New Contributor II

There is no built-in service that will do this, but there may be a third-party menu extra or two (TextBar comes to mind: http://www.richsomerfield.com/apps/) that you can install that would offer this feature. Alternatively you could do some sort of automated action to generate a desktop image that contains this, implementation of a static folder on the Dock that has this (though this would be cumbersome), or similar.

mm2270
Legendary Contributor III

I don't think the OS has anything built in to show the Computer Name in the menubar, but user's can see the computer name a few different ways, like in System Information.app for one. Is that not good enough? Does it really need to be right in the menubar?

emily
Valued Contributor III
Valued Contributor III

You could always integrate something like that into Hello-IT.

mm2270
Legendary Contributor III

For really simple menubar items, there's also Platypus. Its not super advanced, but if you only need it to display information and you know how to write a shell script, you can make a menubar item with it.

Nix4Life
Valued Contributor

I began naming the Hard Drive with the name from Sys Prefs > Sharing a few years ago. Worked out well and is scriptable for a first boot script

my 0.2
LS

sean
Valued Contributor

Not necessarily the best method to rely on. If you read Apple's documentation on menus:

Menu Bar Extras Users, and not apps, place menu bar extras in the menu bar. Typically, users decide to hide or show a menu bar extra by changing a setting in the appropriate preferences pane. If there isn’t enough room in the menu bar to display all menus, OS X automatically removes menu bar extras to make room for app menus. Similarly, if there are too many menu bar extras, OS X may remove some of them to avoid crowding app menus. Don’t rely on the presence of menu bar extras. The system might change which menu bar extras are visible, and you can’t be sure which menu bar extras users have chosen to show or hide.

We also name the system drive after the machine name. You could also look at setting wallpaper which includes the machine name if you feel it would help.

We have a small app that we install that users can run that displays some simple information, eg. machine name, ip. Platypus would also be good for making this kind of an app.

marktaylor
Contributor

We use the 'click on the clock' feature at the login screen to reveal hostname, IP address, OS version and build. This saves logging into the computer to find this information. It doesn't help once a user is logged on but I thought I'd throw it in the pot!
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName

tkessler
New Contributor II

For user ability to remove menu extras, you can somewhat enforce settings with managed preferences, or by a login script. This can be done with a login hook in JSS to target the preferences either with profile settings, or by a defaults command, such as the following to append the menu extra path to the systemuiserver preferences.

defaults write com.apple.systemuiserver menuExtras -array-add "/path/to/item.menu"

Alternatively, you could just have the login hook open the menu extra directly, which should have it open directly whenever the user logs on. You can also regularly issue a remote command to systems (Applescript through Remote Apple Events, a third-party service like JumpCloud, JSS, or other MDM) to have them open the menu extra regularly. You can also implement a launch agent that runs periodically for each user account and does the same thing, so the menu extra will be persistent.

For whatever approach you choose, if you make these options conditional on the status of the current menu extra processes that are running (ie, scripted), then you should be able to get a solution that keeps the desired menu extra open without any conflicts.