From d45a31853c39a836b0d329f5fd401133bcc66461 Mon Sep 17 00:00:00 2001 From: Giovanni Geraci Date: Mon, 4 Nov 2024 06:53:59 +0100 Subject: [PATCH] Improve tuned detection (#788) --- auto_cpufreq/power_helper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/auto_cpufreq/power_helper.py b/auto_cpufreq/power_helper.py index 3662ed8..41c7e05 100644 --- a/auto_cpufreq/power_helper.py +++ b/auto_cpufreq/power_helper.py @@ -110,7 +110,8 @@ def gnome_power_start_live(): if systemctl_exists: call(["systemctl", "start", "power-profiles-daemon"]) def tuned_start_live(): - if systemctl_exists: call(["systemctl", "start", "tuned"]) + if systemctl_exists and tuned_stat_exists: + call(["systemctl", "start", "tuned"]) # enable gnome >= 40 power profiles (uninstall) def gnome_power_svc_enable(): @@ -127,13 +128,13 @@ def gnome_power_svc_enable(): print(GITHUB+"/issues") def tuned_svc_enable(): - if systemctl_exists: + if systemctl_exists and tuned_stat_exists: try: print("* Enabling TuneD\n") call(["systemctl", "unmask", "tuned"]) call(["systemctl", "enable", "--now", "tuned"]) except: - print("\nUnable to enable GNOME power profiles") + print("\nUnable to enable TuneD daemon") print("If this causes any problems, please submit an issue:") print(GITHUB+"/issues")