mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-07-31 06:04:45 +02:00
update themes/agnoster.zsh-theme : display power usage only when not charging
This commit is contained in:
parent
f15deb7557
commit
04948b94f9
1 changed files with 8 additions and 4 deletions
|
|
@ -201,14 +201,14 @@ prompt_battery() {
|
||||||
PLUG_CHAR='🔌'
|
PLUG_CHAR='🔌'
|
||||||
}
|
}
|
||||||
|
|
||||||
local LEVEL1 LEVEL2 LEVEL3 LEVEL4
|
local LEVEL1 LEVEL2 LEVEL3 LEVEL4 online
|
||||||
LEVEL1=95
|
LEVEL1=95
|
||||||
LEVEL2=50
|
LEVEL2=50
|
||||||
LEVEL3=15
|
LEVEL3=15
|
||||||
LEVEL4=5
|
LEVEL4=5
|
||||||
|
|
||||||
if [ $(< /sys/class/power_supply/AC0/online) -ne '0' ]
|
online=$(< /sys/class/power_supply/AC0/online)
|
||||||
then
|
if [ ${online} -ne 0 ]; then
|
||||||
prompt_segment blue grey "${PLUG_CHAR} "
|
prompt_segment blue grey "${PLUG_CHAR} "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -226,7 +226,11 @@ prompt_battery() {
|
||||||
else bg="magenta"; fg="yellow"
|
else bg="magenta"; fg="yellow"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prompt_segment ${bg} ${fg} "[${BAT} "${cap}"/"${sign}${power}"W]"
|
if [ ${online} -ne 0 ]; then
|
||||||
|
prompt_segment ${bg} ${fg} "[${BAT} "${cap}"W]"
|
||||||
|
else
|
||||||
|
prompt_segment ${bg} ${fg} "[${BAT} "${cap}"/"${sign}${power}"W]"
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue