mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-27 07:34:25 +02:00
Revert "Adjust CPU frequency scaling on desktop to run in "performance" governor #162"
This reverts commit fc56e2a1cb861ea217e92c2e0cfdc4812817b548.
This commit is contained in:
parent
bb63f7148a
commit
72e2cb78e3
@ -117,16 +117,10 @@ def charging():
|
|||||||
"""
|
"""
|
||||||
power_dir = "/sys/class/power_supply/"
|
power_dir = "/sys/class/power_supply/"
|
||||||
|
|
||||||
computer_type = getoutput('hostnamectl status | grep Chassis | cut -f2 -d \":\" | tr -d \' \'')
|
# AC adapter states: 0, 1, unknown
|
||||||
|
ac_info = getoutput(f"grep . {power_dir}A*/online").splitlines()
|
||||||
if computer_type == "laptop":
|
# if there's one ac-adapter on-line, ac_state is True
|
||||||
# AC adapter states: 0, 1, unknown
|
ac_state = any(['1' in ac.split(':')[-1] for ac in ac_info])
|
||||||
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
|
|
||||||
|
|
||||||
# Possible values: Charging, Discharging, Unknown
|
# Possible values: Charging, Discharging, Unknown
|
||||||
battery_info = getoutput(f"grep . {power_dir}BAT*/status")
|
battery_info = getoutput(f"grep . {power_dir}BAT*/status")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user