From 95cfbe8920b2675a148ce6c23d13d78bb8771afb Mon Sep 17 00:00:00 2001 From: Infinite State <165737308+infstate@users.noreply.github.com> Date: Fri, 8 Nov 2024 07:06:47 -0800 Subject: [PATCH] fix: Autocpu-freq script not detecting battery on laptops (#877) * Add refined check * remove an unneccessary comment Co-authored-by: nyx --------- Co-authored-by: Adam Perkowski Co-authored-by: nyx --- core/tabs/utils/power-profile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tabs/utils/power-profile.sh b/core/tabs/utils/power-profile.sh index 1efdadcb..9c242c4d 100644 --- a/core/tabs/utils/power-profile.sh +++ b/core/tabs/utils/power-profile.sh @@ -48,7 +48,7 @@ configureAutoCpufreq() { if command_exists auto-cpufreq; then # Check if the system has a battery to determine if it's a laptop - if [ -d /sys/class/power_supply/BAT0 ]; then + if ls /sys/class/power_supply/BAT* >/dev/null 2>&1; then printf "%b\n" "${GREEN}System detected as laptop. Updating auto-cpufreq for laptop...${RC}" "$ESCALATION_TOOL" auto-cpufreq --force powersave else