Latest updates to DE
This commit is contained in:
parent
4f621f9874
commit
41c39315b6
26 changed files with 60 additions and 65 deletions
|
@ -1,10 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
#First we get the capacity
|
||||
charge=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
bat=$1
|
||||
charge=$(cat /sys/class/power_supply/$bat/capacity)
|
||||
|
||||
#Now get the status
|
||||
bstat=$(cat /sys/class/power_supply/BAT0/status)
|
||||
bstat=$(cat /sys/class/power_supply/$bat/status)
|
||||
|
||||
#Get the symbol for the capacity
|
||||
if [ "$bstat" = "Charging" ]; then
|
||||
|
@ -14,49 +15,19 @@ else
|
|||
fi
|
||||
if [ "$charge" -gt 90 ]; then
|
||||
bat="$cstat"
|
||||
charge=""
|
||||
elif [ "$charge" -gt 70 ]; then
|
||||
bat="$cstat"
|
||||
charge=""
|
||||
elif [ "$charge" -gt 50 ]; then
|
||||
bat="$cstat"
|
||||
charge=""
|
||||
elif [ "$charge" -gt 20 ]; then
|
||||
bat="$cstat"
|
||||
charge=""
|
||||
else
|
||||
bat=" $cstat"
|
||||
charge=" $charge%"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
battery="$bat $charge%"
|
||||
|
||||
if [ -d /sys/class/power_supply/BAT1 ]; then
|
||||
|
||||
#First we get the capacity
|
||||
charge=$(cat /sys/class/power_supply/BAT1/capacity)
|
||||
|
||||
#Now get the status
|
||||
bstat=$(cat /sys/class/power_supply/BAT1/status)
|
||||
if [ "$bstat" = "Charging" ]; then
|
||||
cstat=""
|
||||
else
|
||||
cstat=""
|
||||
fi
|
||||
#Get the symbol for the capacity
|
||||
if [ "$charge" -gt 90 ]; then
|
||||
bat="$cstat"
|
||||
elif [ "$charge" -gt 70 ]; then
|
||||
bat="$cstat"
|
||||
elif [ "$charge" -gt 50 ]; then
|
||||
bat="$cstat"
|
||||
elif [ "$charge" -gt 20 ]; then
|
||||
bat="$cstat"
|
||||
else
|
||||
bat=" $cstat"
|
||||
fi
|
||||
|
||||
echo "$bat $charge% $battery"
|
||||
else
|
||||
echo $battery
|
||||
fi
|
||||
|
||||
|
||||
echo "$bat$charge "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue