Merge pull request #104 from dylanaraps/battery_fix
Fix the battery check on PCs without a battery.
This commit is contained in:
commit
726ffbb10e
2
fetch
2
fetch
|
@ -1346,7 +1346,7 @@ getdisk () {
|
||||||
getbattery () {
|
getbattery () {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux")
|
"Linux")
|
||||||
if [ -d "/sys/class/power_supply" ]; then
|
if [ "$(ls /sys/class/power_supply/)" ]; then
|
||||||
# Set the index to the battery number.
|
# Set the index to the battery number.
|
||||||
case "$battery_num" in
|
case "$battery_num" in
|
||||||
"all") battery_num="*" index=0 ;;
|
"all") battery_num="*" index=0 ;;
|
||||||
|
|
Reference in New Issue