Skip to content

Commit

Permalink
Revert "Adjust CPU frequency scaling on desktop to run in "performanc…
Browse files Browse the repository at this point in the history
…e" governor #162"

This reverts commit fc56e2a.
  • Loading branch information
AdnanHodzic committed Feb 3, 2021
1 parent bb63f71 commit 72e2cb7
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,10 @@ def charging():
"""
power_dir = "/sys/class/power_supply/"

computer_type = getoutput('hostnamectl status | grep Chassis | cut -f2 -d \":\" | tr -d \' \'')

if computer_type == "laptop":
# AC adapter states: 0, 1, unknown
ac_info = getoutput(f"grep . {power_dir}A*/online").splitlines()
# if there's one ac-adapter on-line, ac_state is True
ac_state = any(['1' in ac.split(':')[-1] for ac in ac_info])
else:
# if desktop ac_state is true
ac_state = True
# AC adapter states: 0, 1, unknown
ac_info = getoutput(f"grep . {power_dir}A*/online").splitlines()
# if there's one ac-adapter on-line, ac_state is True
ac_state = any(['1' in ac.split(':')[-1] for ac in ac_info])

# Possible values: Charging, Discharging, Unknown
battery_info = getoutput(f"grep . {power_dir}BAT*/status")
Expand Down

0 comments on commit 72e2cb7

Please sign in to comment.