From 1f342d7f806d8b69c88b1c340ee48f844440e4c2 Mon Sep 17 00:00:00 2001 From: Giovanni Geraci Date: Mon, 4 Nov 2024 14:45:31 +0100 Subject: [PATCH] refactor: remove unnecessary code lines for clarity and maintainability --- auto_cpufreq/power_helper.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/auto_cpufreq/power_helper.py b/auto_cpufreq/power_helper.py index 41c7e058..0c376992 100644 --- a/auto_cpufreq/power_helper.py +++ b/auto_cpufreq/power_helper.py @@ -119,9 +119,7 @@ def gnome_power_svc_enable(): try: print("* Enabling GNOME power profiles\n") call(["systemctl", "unmask", "power-profiles-daemon"]) - call(["systemctl", "start", "power-profiles-daemon"]) - call(["systemctl", "enable", "power-profiles-daemon"]) - call(["systemctl", "daemon-reload"]) + call(["systemctl", "enable", "--now", "power-profiles-daemon"]) except: print("\nUnable to enable GNOME power profiles") print("If this causes any problems, please submit an issue:") @@ -221,10 +219,8 @@ def disable_power_profiles_daemon(): # always disable power-profiles-daemon try: print("\n* Disabling GNOME power profiles") - call(["systemctl", "stop", "power-profiles-daemon"]) - call(["systemctl", "disable", "power-profiles-daemon"]) + call(["systemctl", "disable", "--now", "power-profiles-daemon"]) call(["systemctl", "mask", "power-profiles-daemon"]) - call(["systemctl", "daemon-reload"]) except: print("\nUnable to disable GNOME power profiles") print("If this causes any problems, please submit an issue:")