Haiku: Added battery support
This commit is contained in:
parent
342942e727
commit
68a14e5b1f
7
neofetch
7
neofetch
|
@ -310,6 +310,7 @@ getuptime() {
|
|||
uptime="$(uptime -u)"
|
||||
uptime="${uptime/up }"
|
||||
;;
|
||||
|
||||
*)
|
||||
# Get uptime in seconds
|
||||
case "$os" in
|
||||
|
@ -1735,6 +1736,12 @@ getbattery() {
|
|||
[ "$battery" ] && \
|
||||
battery+="%"
|
||||
;;
|
||||
|
||||
"Haiku")
|
||||
battery0full="$(awk -F '[^0-9]*' 'NR==2 {print $4}' /dev/power/acpi_battery/0)"
|
||||
battery0now="$(awk -F '[^0-9]*' 'NR==5 {print $4}' /dev/power/acpi_battery/0)"
|
||||
battery="$((battery0full / battery0now * 100))%"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$battery_state" in
|
||||
|
|
Reference in New Issue