From a1cd9fd88bb539c65ed14eb69927bb84fa1623ac Mon Sep 17 00:00:00 2001 From: gimbles Date: Thu, 24 Nov 2022 16:53:34 +0530 Subject: [PATCH 1/2] usr/local/bin instead of usr/bin/ --- auto_cpufreq/core.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 54c61cd7..65a41878 100644 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/local/bin/env python3 # # auto-cpufreq - core functionality @@ -294,8 +294,8 @@ def cpufreqctl(): pass else: # deploy cpufreqctl.auto-cpufreq script - if not os.path.isfile("/usr/bin/cpufreqctl.auto-cpufreq"): - shutil.copy(SCRIPTS_DIR / "cpufreqctl.sh", "/usr/bin/cpufreqctl.auto-cpufreq") + if not os.path.isfile("/usr/local/bin/cpufreqctl.auto-cpufreq"): + shutil.copy(SCRIPTS_DIR / "cpufreqctl.sh", "/usr/local/bin/cpufreqctl.auto-cpufreq") def cpufreqctl_restore(): @@ -306,8 +306,8 @@ def cpufreqctl_restore(): if os.getenv("PKG_MARKER") == "SNAP": pass else: - if os.path.isfile("/usr/bin/cpufreqctl.auto-cpufreq"): - os.remove("/usr/bin/cpufreqctl.auto-cpufreq") + if os.path.isfile("/usr/local/bin/cpufreqctl.auto-cpufreq"): + os.remove("/usr/local/bin/cpufreqctl.auto-cpufreq") def footer(l=79): @@ -354,10 +354,10 @@ def deploy_daemon(): auto_cpufreq_stats_path.touch(exist_ok=True) print("\n* Deploy auto-cpufreq install script") - shutil.copy(SCRIPTS_DIR / "auto-cpufreq-install.sh", "/usr/bin/auto-cpufreq-install") + shutil.copy(SCRIPTS_DIR / "auto-cpufreq-install.sh", "/usr/local/bin/auto-cpufreq-install") print("\n* Deploy auto-cpufreq remove script") - shutil.copy(SCRIPTS_DIR / "auto-cpufreq-remove.sh", "/usr/bin/auto-cpufreq-remove") + shutil.copy(SCRIPTS_DIR / "auto-cpufreq-remove.sh", "/usr/local/bin/auto-cpufreq-remove") # output warning if gnome power profile is running gnome_power_detect_install() @@ -366,7 +366,7 @@ def deploy_daemon(): # output warning if TLP service is detected tlp_service_detect() - call("/usr/bin/auto-cpufreq-install", shell=True) + call("/usr/local/bin/auto-cpufreq-install", shell=True) def deploy_daemon_performance(): @@ -388,10 +388,10 @@ def deploy_daemon_performance(): auto_cpufreq_stats_path.touch(exist_ok=True) print("\n* Deploy auto-cpufreq install script") - shutil.copy(SCRIPTS_DIR / "auto-cpufreq-install.sh", "/usr/bin/auto-cpufreq-install") + shutil.copy(SCRIPTS_DIR / "auto-cpufreq-install.sh", "/usr/local/bin/auto-cpufreq-install") print("\n* Deploy auto-cpufreq remove script") - shutil.copy(SCRIPTS_DIR / "auto-cpufreq-remove.sh", "/usr/bin/auto-cpufreq-remove") + shutil.copy(SCRIPTS_DIR / "auto-cpufreq-remove.sh", "/usr/local/bin/auto-cpufreq-remove") # output warning if gnome power profile is running gnome_power_detect_install() @@ -400,14 +400,14 @@ def deploy_daemon_performance(): # output warning if TLP service is detected tlp_service_detect() - call("/usr/bin/auto-cpufreq-install", shell=True) + call("/usr/local/bin/auto-cpufreq-install", shell=True) # remove auto-cpufreq daemon def remove(): # check if auto-cpufreq is installed - if not os.path.exists("/usr/bin/auto-cpufreq-remove"): + if not os.path.exists("/usr/local/bin/auto-cpufreq-remove"): print("\nauto-cpufreq daemon is not installed.\n") sys.exit(1) @@ -421,10 +421,10 @@ def remove(): gnome_power_svc_enable() # run auto-cpufreq daemon remove script - call("/usr/bin/auto-cpufreq-remove", shell=True) + call("/usr/local/bin/auto-cpufreq-remove", shell=True) # remove auto-cpufreq-remove - os.remove("/usr/bin/auto-cpufreq-remove") + os.remove("/usr/local/bin/auto-cpufreq-remove") # delete stats file if auto_cpufreq_stats_path.exists(): From 59c665b5776a961cff4190acfe3df1696c3c5040 Mon Sep 17 00:00:00 2001 From: gimbles Date: Thu, 24 Nov 2022 16:54:05 +0530 Subject: [PATCH 2/2] fix shebang --- auto_cpufreq/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 65a41878..b397d694 100644 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -1,4 +1,4 @@ -#!/usr/local/bin/env python3 +#!/usr/bin/env python3 # # auto-cpufreq - core functionality