1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 09:51:44 +08:00

feat(battery): support custom AC indicator (#12528)

This commit is contained in:
张新伟 2024-07-02 23:22:58 +08:00 committed by GitHub
parent bdd9ee3687
commit 5acaa240d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -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.

View File

@ -58,7 +58,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
fi
echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
else
echo ""
echo "${BATTERY_CHARGING-⚡️}"
fi
}