mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 12:09:55 +00:00
added power status for single battery
This commit is contained in:
5
neofetch
5
neofetch
@@ -1551,7 +1551,8 @@ getbattery () {
|
||||
|
||||
# Create an array of battery usage from each battery.
|
||||
batteries=($(cat /sys/class/power_supply/BAT${battery_num}/capacity))
|
||||
|
||||
# Get the power status
|
||||
power_status=($(cat /sys/class/power_supply/BAT${battery_num}/status))
|
||||
# Get the subtitle and reassign it so it doesn't change.
|
||||
title="$subtitle"
|
||||
|
||||
@@ -1579,7 +1580,7 @@ getbattery () {
|
||||
return
|
||||
fi
|
||||
|
||||
battery="${batteries[0]}%"
|
||||
battery="${batteries[0]}% ${power_status}"
|
||||
fi
|
||||
else
|
||||
battery="None"
|
||||
|
||||
Reference in New Issue
Block a user