From 1aed0f74770c57f638e40843abdc71e7377d9bb9 Mon Sep 17 00:00:00 2001 From: Adnan Hodzic Date: Tue, 23 Nov 2021 08:32:15 +0100 Subject: [PATCH] Add option to un/mask power-profiles-daemon --- auto-cpufreq-installer | 1 + auto_cpufreq/core.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/auto-cpufreq-installer b/auto-cpufreq-installer index 8685682..e4012a9 100755 --- a/auto-cpufreq-installer +++ b/auto-cpufreq-installer @@ -184,6 +184,7 @@ function tool_remove { [ -f $stats_file ] && rm $stats_file # enable GNOME power profiles in case it was disabled by auto-cpufreq + systemctl unmask power-profiles-daemon systemctl start power-profiles-daemon systemctl enable power-profiles-daemon diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 8d9ff1f..7ba4957 100644 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -1093,7 +1093,6 @@ def gnome_power_disable_live(): if(gnome_power_stats == 0): print("Disabling GNOME power profiles") call(["systemctl", "stop", "power-profiles-daemon"]) - #call(["systemctl", "mask", "power-profiles-daemon"]) else: print("GNOME power already disabled") @@ -1104,6 +1103,7 @@ def gnome_power_disable(): print("Disabling GNOME power profiles") call(["systemctl", "stop", "power-profiles-daemon"]) call(["systemctl", "disable", "power-profiles-daemon"]) + call(["systemctl", "mask", "power-profiles-daemon"]) else: print("GNOME power already disabled") @@ -1112,6 +1112,7 @@ def gnome_power_enable(): gnome_power_stats = call(["systemctl", "is-active", "--quiet", "power-profiles-daemon"]) if(gnome_power_stats == 0): print("Enabling GNOME power profiles") + call(["systemctl", "unmask", "power-profiles-daemon"]) call(["systemctl", "start", "power-profiles-daemon"]) call(["systemctl", "enable", "power-profiles-daemon"]) else: