Don't display battery %age on WSL system with no battery
This commit is contained in:
parent
2bb99ee369
commit
6629046ec2
@ -31,7 +31,9 @@ while true; do
|
|||||||
raw_battery=$(powershell.exe -NoProfile \
|
raw_battery=$(powershell.exe -NoProfile \
|
||||||
"(Get-WmiObject win32_battery).EstimatedChargeRemaining" \
|
"(Get-WmiObject win32_battery).EstimatedChargeRemaining" \
|
||||||
| sed 's/\r//')
|
| sed 's/\r//')
|
||||||
battery=$(printf "%3d%%" "$raw_battery")
|
if [ "" != "$raw_battery" ]; then
|
||||||
|
battery=$(printf "%3d%%" "$raw_battery")
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$cpu_temp$cpu_load$battery" > $cache_file
|
echo "$cpu_temp$cpu_load$battery" > $cache_file
|
||||||
# echo -e "HTTP/1.1 200 OK\n\n$cpu_temp $cpu_load" | nc -l -k -p 8080 -q 1;
|
# echo -e "HTTP/1.1 200 OK\n\n$cpu_temp $cpu_load" | nc -l -k -p 8080 -q 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user