I'm trouble finding a way to disable showing the system battery icon on the menu bar. I can disable it from System preferences -> Energy Saver -> "Show battery status in menu bar", but is there a way to achieve the same with a terminal defaults
command (or using a simple cocoa app)?
Asked
Active
Viewed 786 times
5

Rene
- 136
- 1
- 7
-
1Think about it. What does it do for the user experience if my battery icon disappears while I'm using some bloody app? What are your chances of this being allowed on the app store? It's a system preference. It's not for you to fiddle around with. – gnasher729 Oct 25 '15 at 13:16
-
I don't think it's appropriate to make moral judgements about questions like this, @gnasher729. I use a very nice little app named cDock to modify the system preferences for my Dock, for example, including prefs Apple doesn't make public. I can easily imagine someone doing something similar for menu bar items that would be useful. You can't just jump to the conclusion that Rene plans to arbitrarily and unexpectedly hide the battery icon. At the very least, ask. I am upvoting the question. – bhaller Oct 25 '15 at 13:36
-
@gnasher729 - sure, I know what you mean. It's just that it's for an app that basically extends the functionality of the built-in one, so having an option to hide one of the two battery menu items might make sense for users. – Rene Oct 25 '15 at 18:12
-
Yes there is take a look here at my last comment: https://superuser.com/questions/398071/how-can-i-hide-show-the-wi-fi-menu-item-from-the-terminal-in-os-x/1187870#1187870 – Bojoer Mar 12 '17 at 11:20
1 Answers
1
You can use the defaults way in terminal to just use this and don't forget to use the killall SystemUIServer or to restart/logout & login.
# Menu bar: hide the Time Machine, Volume, User and AirPort (WiFi) icons
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/User.menu" \
"/System/Library/CoreServices/Menu Extras/AirPort.menu"
done
defaults write com.apple.systemuiserver menuExtras -array \
"/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
"/System/Library/CoreServices/Menu Extras/Battery.menu" \
"/System/Library/CoreServices/Menu Extras/Clock.menu"
killall SystemUIServer
So just move the once you want to hide in the dontAutoLoad array and the ones you wan't visible in the menuExtras array.

Bojoer
- 898
- 9
- 19