Fix bug in detecting battery...

This commit is contained in:
2026-06-26 22:09:28 -04:00
parent b3f2c2c4f4
commit 68507b0252
+3 -3
View File
@@ -3,13 +3,13 @@ _debug "Sourcing tcshrc.system.Linux..."
unsetenv CSHENV_BATTERY_DEVICE
unsetenv CSHENV_SHOW_BATTERY_LEVEL
set battery_locations=( `ls /sys/class/power_supply/ | grep 'BAT[[:digit:]]+$' | xargs` )
set battery_locations=`ls /sys/class/power_supply/ | grep 'BAT[[:digit:]]\+$' | xargs`
_debug "Locations: ${battery_locations}"
if( ${#battery_locations} > 0 ) then
foreach location ${battery_locations}
setenv CSHENV_BATTERY_DEVICE ${location}/capacity
foreach location ( ${battery_locations} )
setenv CSHENV_BATTERY_DEVICE /sys/class/power_supply/${location}/capacity
setenv CSHENV_SHOW_BATTERY_LEVEL
end
endif