fix: Autocpu-freq script not detecting battery on laptops (#877)

* Add refined check

* remove an unneccessary comment

Co-authored-by: nyx <nnyyxxxx@protonmail.com>

---------

Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
Co-authored-by: nyx <nnyyxxxx@protonmail.com>
This commit is contained in:
Infinite State 2024-11-08 07:06:47 -08:00 committed by GitHub
parent 0d4688d53e
commit 95cfbe8920
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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