dotfiles
dotfiles copied to clipboard
[.macos] Hide battery percentage (com.apple.menuextra.battery user defaults)
In reply to this commit, it is still possible to hide battery percentage [at least on OS X 10.9.5 Mavericks]. However, display remaining battery time has been removed by Apple.
defaults write com.apple.menuextra.battery ShowPercent -bool false # Hide battery percentage.
The correct values to be set on High Sierra are YES
and NO
:
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
defaults write com.apple.menuextra.battery ShowPercent -string "NO"
I'm not sure since which macOS version, though.
what @kvpb posted does not work with OS X 10.11.6 El Capitan, at least.
Works with macOS 10.15.7, remember to killall SystemUIServer
for it to take effect.
In macOS Monterey, we should use the following commands to show the battery percentage:
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage -bool true
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage -bool false
It is not necessary to reset any module/application to see the changes.
You can just use -curentHost
defaults -currentHost write com.apple.controlcenter.plist BatteryShowPercentage -bool true