diff --git a/extra/service/legiond/modules/powerstate.c b/extra/service/legiond/modules/powerstate.c index 3f895df..a2c0a32 100644 --- a/extra/service/legiond/modules/powerstate.c +++ b/extra/service/legiond/modules/powerstate.c @@ -12,6 +12,9 @@ POWER_STATE get_powerstate() FILE *fp; fp = fopen(ac_path, "r"); + if (fp == NULL) + fp = fopen(ac_path_alt, "r"); + int ac_state; if (fscanf(fp, "%d", &ac_state) != 1) { printf("failed to get AC status\n"); diff --git a/extra/service/legiond/modules/powerstate.h b/extra/service/legiond/modules/powerstate.h index 86364f3..c21235e 100644 --- a/extra/service/legiond/modules/powerstate.h +++ b/extra/service/legiond/modules/powerstate.h @@ -15,6 +15,7 @@ typedef enum _POWER_STATE { #define P_ERROR_AC -2 #define ac_path "/sys/class/power_supply/ADP0/online" +#define ac_path_alt "/sys/class/power_supply/ADP0/online" #define profile_path "/sys/firmware/acpi/platform_profile" POWER_STATE get_powerstate();