ChrisTitusTech / linutil

Chris Titus Tech's Linux Toolbox - Linutil is a distro-agnostic toolbox designed to simplify everyday Linux tasks.
https://christitus.com
MIT License
2.66k stars 220 forks source link

Auto cpu-freq fails to detect laptop and apply tweaks #871

Open jeevithakannan2 opened 1 day ago

jeevithakannan2 commented 1 day ago

Describe the bug

Auto cpu-freq fails to detect laptop. And fails to apply tweaks after installation.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'utilites'
  2. Click on 'Auto Power Profiling'
  3. Install 'auto cpu-freq'
  4. Apply tweaks
  5. See error

Expected behavior

Able to detect laptop and apply tweaks.

Screenshots

image

Additional context

Some laptops does not have battery in BAT0 instead they have in BAT1 or BAT2. Need to run sudo auto-cpufreq --install first time.

Checklist

jeevithakannan2 commented 1 day ago

/label 'script'

adamperkowski commented 1 day ago

hmm that's funny. so you're saying what's exactly wrong? we need to detect the BAT device first?

jeevithakannan2 commented 1 day ago

That's how the current script works. It checks for only BAT0

jeevithakannan2 commented 1 day ago

Also it fails to work because sudo auto cpu-freq --install should be ran before trying to apply tweaks

adamperkowski commented 1 day ago

Yeah so this here https://github.com/ChrisTitusTech/linutil/blob/e3688e9b3d2f3594bf2367af87a800db9e2f1bbd/core/tabs/utils/power-profile.sh#L48

should be checking multiple BATs

jeevithakannan2 commented 1 day ago

Yeah so this here

https://github.com/ChrisTitusTech/linutil/blob/e3688e9b3d2f3594bf2367af87a800db9e2f1bbd/core/tabs/utils/power-profile.sh#L48

should be checking multiple BATs

Yeah it should be somewhat like if [ -d /sys/class/power_supply/BAT* ]

jeevithakannan2 commented 1 day ago

I usually check with dmidecode -s chassis-type but it requires dmidecode to be installed