diff --git a/system-info/system-info-WSL.sh b/system-info/system-info-WSL.sh index 230aac1..1a6b4e0 100755 --- a/system-info/system-info-WSL.sh +++ b/system-info/system-info-WSL.sh @@ -20,10 +20,12 @@ else return 1 fi +powershell="/mnt/c/Windows/System32/WindowsPowerShell/v1.0//powershell.exe" + while true; do # Assumes OpenHardwareMonitor is running and emitting data to WMI so we can # access it via the Windows hosts powershell.exe. - raw_cpu_temp=$(powershell.exe -NoProfile \ + raw_cpu_temp=$($powershell -NoProfile \ "(Get-WmiObject -Namespace \"root/OpenHardwareMonitor\" -Query 'select Value from Sensor WHERE Identifier LIKE \"$cpu_temp_sensor\"').Value" \ | sed 's/\r//') cpu_temp=$(printf "%.1f°C" "$raw_cpu_temp") @@ -32,7 +34,7 @@ while true; do jq '.sysstat.hosts[0].statistics[0]["cpu-load"][1:]|.[].idle' | \ awk '$idle ~ /[-.0-9]*/ { printf "%s", substr("█▇▆▅▄▃▂▁ ", int($idle / 11), 1) }'`" - raw_battery=$(powershell.exe -NoProfile \ + raw_battery=$($powershell -NoProfile \ "(Get-WmiObject win32_battery).EstimatedChargeRemaining" \ | sed 's/\r//') if [ "" != "$raw_battery" ]; then @@ -42,6 +44,6 @@ while true; do fi 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 "$(locale)" > $cache_file sleep 2 done diff --git a/system-info/system-info.service b/system-info/system-info.service deleted file mode 100644 index c47ff23..0000000 --- a/system-info/system-info.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=System Info - -[Service] -ExecStart=/home/benie/.config/tmux/system-info/system-info-Linux.sh - -[Install] -WantedBy=default.target