From 406f2ad91ac27404a22138ca26f4fb1e2c4b2ffe Mon Sep 17 00:00:00 2001 From: Infinite <165737308+infstate@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:18:08 -0700 Subject: [PATCH 1/2] Add refined check --- 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 536f7c69..239c3483 100644 --- a/core/tabs/utils/power-profile.sh +++ b/core/tabs/utils/power-profile.sh @@ -45,7 +45,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 # Check if the system has a battery (laptop) by looking for any battery directory printf "%b\n" "${GREEN}System detected as laptop. Updating auto-cpufreq for laptop...${RC}" "$ESCALATION_TOOL" auto-cpufreq --force powersave else From 08737151af74ed5d45d84d96f24f5106aa01cc01 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sun, 27 Oct 2024 01:24:07 +0200 Subject: [PATCH 2/2] remove an unneccessary comment 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 239c3483..a05b89ee 100644 --- a/core/tabs/utils/power-profile.sh +++ b/core/tabs/utils/power-profile.sh @@ -45,7 +45,7 @@ configureAutoCpufreq() { if command_exists auto-cpufreq; then # Check if the system has a battery to determine if it's a laptop - if ls /sys/class/power_supply/BAT* >/dev/null 2>&1; then # Check if the system has a battery (laptop) by looking for any battery directory + 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