Commit 484742a 1 parent 27f0690 commit 484742a Copy full SHA for 484742a
File tree 3 files changed +51
-2
lines changed
3 files changed +51
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ Example of `auto-cpufreq --stats` CLI output
56
56
- [ Battery charging thresholds] ( #battery-charging-thresholds )
57
57
- [ Supported Devices] ( #supported-devices )
58
58
- [ Battery config] ( #battery-config )
59
+ - [ Ignoring power supplies] ( #Ignoring-power-supplies )
59
60
- [ Troubleshooting] ( #troubleshooting )
60
61
- [ AUR] ( #aur )
61
62
- [ Discussion] ( #discussion )
@@ -525,6 +526,26 @@ this works only with `lenovo_laptop` kernel module compatable laptops.
525
526
526
527
add ` ideapad_laptop_conservation_mode = true ` to your ` auto-cpufreq.conf ` file
527
528
529
+ ### Ignoring power supplies
530
+
531
+ you may have a controler or headphones and when ever they may be on battery they might cause auto-cpufreq
532
+ to limit preformence to ignore them add to you config file the name of the power supply, under ` [power_supply_ignore_list] `
533
+
534
+ the name of the power supply can be found with ` ls /sys/class/power_supply/ `
535
+
536
+ ```
537
+ [power_supply_ignore_list]
538
+
539
+ name1 = this
540
+ name2 = is
541
+ name3 = an
542
+ name4 = example
543
+
544
+ # like this
545
+ xboxctrl = {the xbox controler power supply name}
546
+
547
+ ```
548
+
528
549
## Troubleshooting
529
550
530
551
** Q:** If after installing auto-cpufreq you're (still) experiencing:
Original file line number Diff line number Diff line change @@ -28,6 +28,17 @@ energy_performance_preference = performance
28
28
# turbo boost setting. possible values: always, auto, never
29
29
turbo = auto
30
30
31
+
32
+ # this is for ignoring controllers and other connected devices battery from affecting
33
+ # laptop preformence
34
+ # [power_supply_ignore_list]
35
+
36
+ # name1 = this
37
+ # name2 = is
38
+ # name3 = an
39
+ # name4 = example
40
+
41
+
31
42
# settings for when using battery power
32
43
[battery]
33
44
# see available governors by running: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
Original file line number Diff line number Diff line change 33
33
SCRIPTS_DIR = Path ("/usr/local/share/auto-cpufreq/scripts/" )
34
34
CPUS = os .cpu_count ()
35
35
36
- # ignore these devices under /sys/class/power_supply/
37
- POWER_SUPPLY_IGNORELIST = ["hidpp_battery" ]
36
+
38
37
39
38
# Note:
40
39
# "load1m" & "cpuload" can't be global vars and to in order to show correct data must be
@@ -220,12 +219,30 @@ def set_turbo(value:bool):
220
219
print ("Setting turbo boost:" , "on" if value else "off" )
221
220
turbo (value )
222
221
222
+
223
+ # ignore these devices under /sys/class/power_supply/
224
+ def get_power_supply_ignore_list ():
225
+
226
+ conf = config .get_config ()
227
+
228
+ list = []
229
+
230
+ if conf .has_section ("power_supply_ignore_list" ):
231
+ for i in conf ["power_supply_ignore_list" ]:
232
+ list .append (conf ["power_supply_ignore_list" ][i ])
233
+
234
+ # these are hard coded power supplies that will always be ignored
235
+ list .append ("hidpp_battery" )
236
+ return list
237
+
238
+
223
239
def charging ():
224
240
"""
225
241
get charge state: is battery charging or discharging
226
242
"""
227
243
# sort it so AC is 'always' first
228
244
power_supplies = sorted (os .listdir (Path (POWER_SUPPLY_DIR )))
245
+ POWER_SUPPLY_IGNORELIST = get_power_supply_ignore_list ()
229
246
230
247
# check if we found power supplies. on a desktop these are not found and we assume we are on a powercable.
231
248
if len (power_supplies ) == 0 : return True # nothing found, so nothing to check
You can’t perform that action at this time.
0 commit comments