mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 12:09:55 +00:00
fixed battery_status to show only charging status + added battery_status to FreeBSD
This commit is contained in:
11
neofetch
11
neofetch
@@ -1579,8 +1579,11 @@ getbattery () {
|
|||||||
done
|
done
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
if [ $power_status = "Charging" ]; then
|
||||||
battery="${batteries[0]}% ${power_status}"
|
battery="${batteries[0]}% ${power_status}"
|
||||||
|
else
|
||||||
|
battery="${batteries[0]}%"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
battery="None"
|
battery="None"
|
||||||
@@ -1590,7 +1593,13 @@ getbattery () {
|
|||||||
"BSD")
|
"BSD")
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
"FreeBSD"*)
|
"FreeBSD"*)
|
||||||
|
power_status=$(acpiconf -i 0 | awk -F ':\t\t\t' '/State/ {print $2}')
|
||||||
|
|
||||||
|
if [ $power_status = "charging" ]; then
|
||||||
|
battery="$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}') $power_status"
|
||||||
|
else
|
||||||
battery=$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')
|
battery=$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"NetBSD"*)
|
"NetBSD"*)
|
||||||
|
|||||||
Reference in New Issue
Block a user