Merge branch 'master' into sysadmin-master

* master:
  Don't panic if no batteries are found on Linux.
This commit is contained in:
2026-06-26 13:51:14 -04:00
+5
View File
@@ -2,10 +2,15 @@ _debug "Sourcing tcshrc.system.Linux..."
unsetenv CSHENV_BATTERY_DEVICE unsetenv CSHENV_BATTERY_DEVICE
unsetenv CSHENV_SHOW_BATTERY_LEVEL 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* ) foreach location ( /sys/class/power_supply/BAT* )
setenv CSHENV_BATTERY_DEVICE ${location}/capacity setenv CSHENV_BATTERY_DEVICE ${location}/capacity
setenv CSHENV_SHOW_BATTERY_LEVEL setenv CSHENV_SHOW_BATTERY_LEVEL
end end
endif
# Set the acknowledgement bit, essentially # Set the acknowledgement bit, essentially
setenv CSHENV_SYSTEM_CONFIGURED Linux setenv CSHENV_SYSTEM_CONFIGURED Linux