Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
batterypercentage.md[Show battery percentage](./menubar/batterypercentage.md)---
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
batterypercentage.md[Show battery percentage](./menubar/batterypercentage.md)---
---

title: macOS defaults list
titleTemplate: false
description: You've already copied `defaults write` commands. Sometimes you don't know what they do and are not sure they still work. This list of macOS defaults commands is here to help.
Expand Down Expand Up @@ -133,6 +133,7 @@ defaults rename ${domain} ${old_key} ${new_key}

- [Flash clock time separators](./menubar/flashdateseparators.md)
- [Set menubar digital clock format](./menubar/dateformat.md)
- [Show battery percentage](./menubar/batterypercentage.md)

### Mouse

Expand Down
60 changes: 60 additions & 0 deletions docs/menubar/batterypercentage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Battery Percentage | Menu Bar
description: When enabled, this command allows you to show or hide (hidden by default) the battery percentage in the menu bar on macOS.
head:
- meta:
property: 'og:title'
content: System Settings → Battery → Show Battery Percentage
- meta:
property: 'og:description'
content: When enabled, this command allows you to show or hide (default) the battery percentage in the menu bar on macOS.
---

# Battery Percentage

When enabled, this command allows you to show or hide (hidden by default) the battery percentage in the menu bar on macOS.

<!-- break lists -->

- **Tested on macOS**:
- Sonoma

- **Parameter type**: bool

## Set to `false` (default value)

Disable Battery Percentage.

```bash
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage -bool false
```

<video autoplay loop muted playsinline width="727" height="40" style="max-width: 100%; height: auto">
<source src="./images/FlashDateSeparators/false.mp4" type="video/mp4">
Example output with value set to false
</video>

## Set to `true`

Enable Battery Percentage.

```bash
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage -bool true
```

## Read current value

```bash
defaults read ~/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage
```

## Reset to default value

```bash
defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist BatteryShowPercentage -bool false
```

## Set value from UI

1. <a href="x-apple.systempreferences:com.apple.ControlCenter-Settings.extension?">Access Clock settings from macOS UI</a>
2. Toggle "Show percentage" value