Fix bug in detecting battery...
This commit is contained in:
+3
-3
@@ -3,13 +3,13 @@ _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[[:digit:]]+$' | xargs` )
|
set battery_locations=`ls /sys/class/power_supply/ | grep 'BAT[[:digit:]]\+$' | xargs`
|
||||||
|
|
||||||
_debug "Locations: ${battery_locations}"
|
_debug "Locations: ${battery_locations}"
|
||||||
|
|
||||||
if( ${#battery_locations} > 0 ) then
|
if( ${#battery_locations} > 0 ) then
|
||||||
foreach location ${battery_locations}
|
foreach location ( ${battery_locations} )
|
||||||
setenv CSHENV_BATTERY_DEVICE ${location}/capacity
|
setenv CSHENV_BATTERY_DEVICE /sys/class/power_supply/${location}/capacity
|
||||||
setenv CSHENV_SHOW_BATTERY_LEVEL
|
setenv CSHENV_SHOW_BATTERY_LEVEL
|
||||||
end
|
end
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user