mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-07-08 01:57:17 +02:00
feat(battery): support custom AC indicator (#12528)
This commit is contained in:
plugins/battery
@ -12,6 +12,13 @@ Then, add the `battery_pct_prompt` function to your custom theme. For example:
|
|||||||
RPROMPT='$(battery_pct_prompt) ...'
|
RPROMPT='$(battery_pct_prompt) ...'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Also, you set the `BATTERY_CHARGING` variable to your favor.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
BATTERY_CHARGING="⚡️"
|
||||||
|
```
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- On Linux, you must have the `acpi` or `acpitool` commands installed on your operating system.
|
- On Linux, you must have the `acpi` or `acpitool` commands installed on your operating system.
|
||||||
|
@ -58,7 +58,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
|
|||||||
fi
|
fi
|
||||||
echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
|
echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
|
||||||
else
|
else
|
||||||
echo "∞"
|
echo "${BATTERY_CHARGING-⚡️}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user