We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95a6843 commit 1e656e6Copy full SHA for 1e656e6
scripts/helpers.sh
@@ -38,9 +38,11 @@ command_exists() {
38
39
battery_status() {
40
if is_wsl; then
41
- local battery
42
- battery=$(find /sys/class/power_supply/*/status | tail -n1)
43
- awk '{print tolower($0);}' "$battery"
+ if [ -e /sys/class/power_supply/*/status ]; then
+ local battery
+ battery=$(find /sys/class/power_supply/*/status | tail -n1)
44
+ awk '{print tolower($0);}' "$battery"
45
+ fi
46
elif command_exists "pmset"; then
47
pmset -g batt | awk -F '; *' 'NR==2 { print $2 }'
48
elif command_exists "acpi"; then
0 commit comments