Skip to content

Commit

Permalink
feat(battery): support custom AC indicator (ohmyzsh#12528)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuujo1573 authored Jul 2, 2024
1 parent bdd9ee3 commit 5acaa24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions plugins/battery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion plugins/battery/battery.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
fi
echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}"
else
echo ""
echo "${BATTERY_CHARGING-⚡️}"
fi
}

Expand Down

0 comments on commit 5acaa24

Please sign in to comment.