mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
Added plugged_in func for linux in battery plugin
Cloned battery_is_charging() func with the same name as the osx version in order to maintain compatibility across the systems in themes that make use of the plugin.
This commit is contained in:
parent
d848c94804
commit
bd8fdbf782
1 changed files with 4 additions and 0 deletions
|
|
@ -70,6 +70,10 @@ elif [[ "$OSTYPE" = linux* ]] ; then
|
|||
! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]]
|
||||
}
|
||||
|
||||
function plugged_in() {
|
||||
! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]]
|
||||
}
|
||||
|
||||
function battery_pct() {
|
||||
if (( $+commands[acpi] )) ; then
|
||||
echo "$(acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue