From 8067e4f03873b15cfb89665d5c46430571310b9b Mon Sep 17 00:00:00 2001 From: siliconair <140966983+siliconair@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:16:00 +0200 Subject: [PATCH 1/3] add "batterypercentage.md" markdown file --- docs/menubar/batterypercentage.md | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 docs/menubar/batterypercentage.md diff --git a/docs/menubar/batterypercentage.md b/docs/menubar/batterypercentage.md new file mode 100644 index 00000000..fd7992af --- /dev/null +++ b/docs/menubar/batterypercentage.md @@ -0,0 +1,61 @@ +--- +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 +separators + - - 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. + + + +- **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 +``` + + + +## 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. Access Clock settings from macOS UI +2. Toggle "Show percentage" value \ No newline at end of file From 183d83606cb179b12cb887d102210519f2d69a3c Mon Sep 17 00:00:00 2001 From: siliconair <140966983+siliconair@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:20:29 +0200 Subject: [PATCH 2/3] correct YAML format --- docs/menubar/batterypercentage.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/menubar/batterypercentage.md b/docs/menubar/batterypercentage.md index fd7992af..ecc0020b 100644 --- a/docs/menubar/batterypercentage.md +++ b/docs/menubar/batterypercentage.md @@ -2,12 +2,11 @@ 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' + - meta: + property: 'og:title' content: System Settings → Battery → Show Battery Percentage -separators - - - meta - - property: 'og:description' + - 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. --- @@ -58,4 +57,4 @@ defaults write ~/Library/Preferences/ByHost/com.apple.controlcenter.plist Batter ## Set value from UI 1. Access Clock settings from macOS UI -2. Toggle "Show percentage" value \ No newline at end of file +2. Toggle "Show percentage" value From b8558556724f9156b6b0617e8b11022a31e1fa21 Mon Sep 17 00:00:00 2001 From: siliconair <140966983+siliconair@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:23:11 +0200 Subject: [PATCH 3/3] Update index.md --- docs/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 04a339eb..a9a3fba6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,4 @@ ---- +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. @@ -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