eww fix battery for desktop
This commit is contained in:
@@ -3,7 +3,9 @@ stat=$(cat /sys/class/power_supply/AC/online)
|
|||||||
|
|
||||||
class="batteryFull"
|
class="batteryFull"
|
||||||
|
|
||||||
if [[ $stat == 1 ]]; then
|
if [ ! -d "/sys/class/power_supply/BAT0" ]; then
|
||||||
|
class="batteryFull"
|
||||||
|
elif [[ $stat == 1 ]]; then
|
||||||
class="batteryCharging"
|
class="batteryCharging"
|
||||||
elif [[ $bat -le 10 ]]; then
|
elif [[ $bat -le 10 ]]; then
|
||||||
class="batteryEmpty"
|
class="batteryEmpty"
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ stat=$(cat /sys/class/power_supply/AC/online)
|
|||||||
|
|
||||||
icon=""
|
icon=""
|
||||||
|
|
||||||
if [[ $stat == 1 ]]; then
|
if [ ! -d "/sys/class/power_supply/BAT0" ]; then
|
||||||
|
icon=""
|
||||||
|
elif [[ $stat == 1 ]]; then
|
||||||
icon=""
|
icon=""
|
||||||
elif [[ $bat -le 10 ]]; then
|
elif [[ $bat -le 10 ]]; then
|
||||||
icon=""
|
icon=""
|
||||||
|
|||||||
@@ -1,2 +1,7 @@
|
|||||||
bat=$(cat /sys/class/power_supply/BAT0/capacity)
|
bat=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||||
|
|
||||||
|
if [ ! -d "/sys/class/power_supply/BAT0" ]; then
|
||||||
|
bat="100"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$bat"
|
echo "$bat"
|
||||||
|
|||||||
Reference in New Issue
Block a user