Don't panic if no batteries are found on Linux.

This commit is contained in:
2026-06-25 16:47:09 -04:00
parent 16ba1a5897
commit adc5d3f6ee
+5
View File
@@ -2,10 +2,15 @@ _debug "Sourcing tcshrc.system.Linux..."
unsetenv CSHENV_BATTERY_DEVICE
unsetenv CSHENV_SHOW_BATTERY_LEVEL
set battery_locations=( `ls /sys/class/power_supply/ | grep 'BAT'` )
if ( $#battery_locations > 0 ) then
foreach location ( /sys/class/power_supply/BAT* )
setenv CSHENV_BATTERY_DEVICE ${location}/capacity
setenv CSHENV_SHOW_BATTERY_LEVEL
end
endif
# Set the acknowledgement bit, essentially
setenv CSHENV_SYSTEM_CONFIGURED Linux