Skip to content

Commit

Permalink
enable_tresholds config file improvements (Closes: AdnanHodzic#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpleWazard authored and rootCircle committed Feb 16, 2024
1 parent 97e63be commit 27944dc
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions auto_cpufreq/battery_scripts/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ def battery_stop_threshold():
def battery_setup():
root_check()
conf = get_config()
if conf.has_option("battery", "enable_thresholds") and conf["battery"]["enable_thresholds"] == "true":
if lsmod("thinkpad_acpi"):
thinkpad_setup(battery_start_threshold(), battery_stop_threshold())
elif lsmod("ideapad_acpi"):
ideapad_setup(battery_start_threshold(), battery_stop_threshold())
if conf.has_option("battery", "enable_thresholds"):
if conf["battery"]["enable_thresholds"] == "true":
if lsmod("thinkpad_acpi"):
thinkpad_setup(battery_start_threshold(), battery_stop_threshold())
elif lsmod("ideapad_acpi"):
ideapad_setup(battery_start_threshold(), battery_stop_threshold())
else:
pass
else:
pass
else:
Expand All @@ -48,13 +51,16 @@ def battery_setup():

def battery_get_thresholds():
conf = get_config()
if conf["battery"]["enable_thresholds"] == "true":
print("-" * 30)
if lsmod("thinkpad_acpi"):
thinkpad_print_thresholds()
elif lsmod("ideapad_acpi"):
ideapad_print_thresholds()
if conf.has_option("battery", "enable_thresholds"):
if conf["battery"]["enable_thresholds"] == "true":
print("-" * 30 )
if lsmod("thinkpad_acpi"):
thinkpad_print_thresholds()
elif lsmod("ideapad_acpi"):
ideapad_print_thresholds()
else:
pass
else:
pass
return
else:
return

0 comments on commit 27944dc

Please sign in to comment.