From 8c5019846713129cd59a67f6b2b51c86a0537c80 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Thu, 18 Jun 2026 09:01:46 -0400 Subject: [PATCH] Auto-probe battery on Linux --- tcshrc.system.Linux | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tcshrc.system.Linux b/tcshrc.system.Linux index 85e8fa1..8acfc47 100644 --- a/tcshrc.system.Linux +++ b/tcshrc.system.Linux @@ -2,6 +2,13 @@ if( $?CSHENV_DEBUG ) then echo "Sourcing tcshrc.system.Linux..." endif +unsetenv CSHENV_BATTERY_DEVICE +unsetenv CSHENV_SHOW_BATTERY_LEVEL +foreach location ( /sys/class/power_supply/BAT* ) +setenv CSHENV_BATTERY_DEVICE ${location}/capacity +setenv CSHENV_SHOW_BATTERY_LEVEL +end + # Set the acknowledgement bit, essentially setenv CSHENV_SYSTEM_CONFIGURED Linux