1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-14 22:47:45 +08:00

Compare commits

..

No commits in common. "621de1e20bbe97dc6d867be47b8e797280bb079c" and "d247f98d3edccfd12224cab077d36124849092ee" have entirely different histories.

3 changed files with 6 additions and 12 deletions

View File

@ -118,7 +118,7 @@ elif [[ "$OSTYPE" = linux* ]]; then
function battery_pct() {
if (( $+commands[acpi] )); then
acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -E '^Battery.*(Full|(Disc|C)harging)' | cut -f2 -d ',' | tr -cd '[:digit:]'
acpi 2>/dev/null | command grep -v "rate information unavailable" | command grep -E '^Battery.*(Disc|C)harging' | cut -f2 -d ',' | tr -cd '[:digit:]'
fi
}
@ -175,7 +175,7 @@ function battery_level_gauge() {
local filled_symbol=${BATTERY_GAUGE_FILLED_SYMBOL:-'▶'}
local empty_symbol=${BATTERY_GAUGE_EMPTY_SYMBOL:-'▷'}
local charging_color=${BATTERY_CHARGING_COLOR:-$color_yellow}
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'%{%G%}'}
local charging_symbol=${BATTERY_CHARGING_SYMBOL:-'⚡'}
local battery_remaining_percentage=$(battery_pct)
local filled empty gauge_color
@ -201,11 +201,11 @@ function battery_level_gauge() {
battery_is_charging && charging=$charging_symbol
# Charging status and prefix
print -n ${charging_color}${charging}${color_reset}${battery_prefix}${gauge_color}
printf ${charging_color//\%/\%\%}$charging${color_reset//\%/\%\%}${battery_prefix//\%/\%\%}${gauge_color//\%/\%\%}
# Filled slots
[[ $filled -gt 0 ]] && printf ${filled_symbol//\%/\%\%}'%.0s' {1..$filled}
# Empty slots
[[ $filled -lt $gauge_slots ]] && printf ${empty_symbol//\%/\%\%}'%.0s' {1..$empty}
# Suffix
print -n ${color_reset}${battery_suffix}${color_reset}
printf ${color_reset//\%/\%\%}${battery_suffix//\%/\%\%}${color_reset//\%/\%\%}
}

View File

@ -8,9 +8,6 @@ To use it, add `colored-man-pages` to the plugins array in your zshrc file:
plugins=(... colored-man-pages)
```
It will also automatically colorize man pages displayed by `dman` or `debman`,
from [`debian-goodies`](https://packages.debian.org/stable/debian-goodies).
You can also try to color other pages by prefixing the respective command with `colored`:
```zsh

View File

@ -31,9 +31,6 @@ function colored() {
"$@"
}
# Colorize man and dman/debman (from debian-goodies)
function man \
dman \
debman {
colored $0 "$@"
function man() {
colored man "$@"
}