Update '.local/bin/battery-combined-udev.sh'

This commit is contained in:
tk1rk 2023-05-20 05:19:44 +02:00
parent 2895d7edd2
commit ed99559c0e
1 changed files with 16 additions and 16 deletions

View File

@ -2,26 +2,26 @@
battery_print() {
PATH_AC="/sys/class/power_supply/AC"
PATH_BATTERY_0="/sys/class/power_supply/BAT0"
PATH_BATTERY_1="/sys/class/power_supply/BAT1"
PATH_BATTERY_0="/sys/class/power_supply/BAT0"
PATH_BATTERY_1="/sys/class/power_supply/BAT1"
ac=0
battery_level_0=0
battery_level_1=0
battery_max_0=0
battery_max_1=0
ac=0
battery_level_0=0
battery_level_1=0
battery_max_0=0
battery_max_1=0
if [ -f "$PATH_AC/online" ]; then
ac=$(cat "$PATH_AC/online")
fi
if [ -f "$PATH_AC/online" ]; then
ac=$(cat "$PATH_AC/online")
fi
if [ -f "$PATH_BATTERY_0/energy_now" ]; then
battery_level_0=$(cat "$PATH_BATTERY_0/energy_now")
fi
if [ -f "$PATH_BATTERY_0/energy_now" ]; then
battery_level_0=$(cat "$PATH_BATTERY_0/energy_now")
fi
if [ -f "$PATH_BATTERY_0/energy_full" ]; then
battery_max_0=$(cat "$PATH_BATTERY_0/energy_full")
fi
if [ -f "$PATH_BATTERY_0/energy_full" ]; then
battery_max_0=$(cat "$PATH_BATTERY_0/energy_full")
fi
if [ -f "$PATH_BATTERY_1/energy_now" ]; then
battery_level_1=$(cat "$PATH_BATTERY_1/energy_now")