There are plenty of tutorials online for checking your battery level in a ubuntu terminal. The most common solution seems to be to use upower
. However, when I run upower
in a WSL Ubuntu shell in Windows 10 on my Surface Pro, I get this:
user@sp4-2637:~/the_thing$ sudo upower(upower:665): UPower-WARNING **: Cannot connect to upowerd: Could not connect: No such file or directory
Running with sudo priviliges yields the same result.
On my laptop running native ubuntu I can query the battery level like this;
cat /sys/class/power_supply/BAT0/capacity
However, this results in the following on my Surface:
user@sp4-2637:~$ cat /sys/class/power_supply/BAT0/capacitycat: /sys/class/power_supply/BAT0/capacity: No such file or directory
How can I query the battery level in a WSL ubuntu shell for a Microsoft Surface?