diff options
Diffstat (limited to 'scripts/on_ac_power')
-rwxr-xr-x | scripts/on_ac_power | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/on_ac_power b/scripts/on_ac_power index 08049525..9ef1df49 100755 --- a/scripts/on_ac_power +++ b/scripts/on_ac_power @@ -9,6 +9,10 @@ if [ -f /proc/acpi/ac_adapter/AC*/state ]; then "state:"*"off-line") return 128;; esac done +elif [ -f /sys/class/power_supply/AC*/online ]; then + cat /sys/class/power_supply/AC*/online | while read line; do + [ "${line}" = 0 ] && return 128 + done elif [ -f /proc/pmu/info ]; then cat /proc/pmu/info | while read line; do case "$line" in |