mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 04:37:49 +02:00
14 lines
314 B
Bash
Executable File
14 lines
314 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Returns true if a battery is present on the system.
|
|
# Used by the battery monitor and other battery-related checks.
|
|
|
|
for bat in /sys/class/power_supply/BAT*; do
|
|
[[ -r "$bat/present" ]] &&
|
|
[[ "$(cat "$bat/present")" == "1" ]] &&
|
|
[[ "$(cat "$bat/type")" == "Battery" ]] &&
|
|
exit 0
|
|
done
|
|
|
|
exit 1
|