From 72e2cb78e316104b3d1ff0df49c17fa030c41db7 Mon Sep 17 00:00:00 2001 From: Adnan Hodzic Date: Wed, 3 Feb 2021 07:22:03 +0100 Subject: [PATCH] Revert "Adjust CPU frequency scaling on desktop to run in "performance" governor #162" This reverts commit fc56e2a1cb861ea217e92c2e0cfdc4812817b548. --- auto_cpufreq/core.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 90ff218..a0d862c 100644 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -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")