summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
author张新伟 <me@ryuujo.com>2024-07-02 23:22:58 +0800
committerGitHub <noreply@github.com>2024-07-02 17:22:58 +0200
commit5acaa240d3dde98f2bc2354ad6201e6954254b2c (patch)
tree2d8b0fd01250592496b60cd387fbdc928bc89eec /plugins
parentbdd9ee3687ffcf2e6ba725a9ab1be62487b8d7e2 (diff)
downloadzsh-5acaa240d3dde98f2bc2354ad6201e6954254b2c.tar.gz
zsh-5acaa240d3dde98f2bc2354ad6201e6954254b2c.tar.bz2
zsh-5acaa240d3dde98f2bc2354ad6201e6954254b2c.zip
feat(battery): support custom AC indicator (#12528)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/battery/README.md7
-rw-r--r--plugins/battery/battery.plugin.zsh2
2 files changed, 8 insertions, 1 deletions
diff --git a/plugins/battery/README.md b/plugins/battery/README.md
index 18e5bd882..73fcb693e 100644
--- a/plugins/battery/README.md
+++ b/plugins/battery/README.md
@@ -12,6 +12,13 @@ Then, add the `battery_pct_prompt` function to your custom theme. For example:
RPROMPT='$(battery_pct_prompt) ...'
```
+Also, you set the `BATTERY_CHARGING` variable to your favor.
+For example:
+
+```zsh
+BATTERY_CHARGING="⚡️"
+```
+
## Requirements
- On Linux, you must have the `acpi` or `acpitool` commands installed on your operating system.
diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh
index 1d3d529a3..7977e4d04 100644
--- a/plugins/battery/battery.plugin.zsh
+++ b/plugins/battery/battery.plugin.zsh
@@ -58,7 +58,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
fi
echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
else
- echo "∞"
+ echo "${BATTERY_CHARGING-⚡️}"
fi
}