diff --git a/auto_cpufreq/core.py b/auto_cpufreq/core.py index 1f83f6f..cae89c8 100644 --- a/auto_cpufreq/core.py +++ b/auto_cpufreq/core.py @@ -371,10 +371,14 @@ def deploy_daemon(): def deploy_daemon_performance(): - print("\n" + "-" * 21 + " Deploying auto-cpufreq as a daemon " + "-" * 22 + "\n") + print("\n" + "-" * 21 + " Deploying auto-cpufreq as a daemon (performance) " + "-" * 22 + "\n") - # ToDo: - # add check that performance exists otherwise exit + # check that performance is in scaling_available_governors + with open("/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") as available_governors: + if "performance" not in available_governors.read(): + print("\"perfomance\" governor is unavailable on this system, run:\n" + "sudo sudo auto-cpufreq --install\n\n" + "to install auto-cpufreq using default \"balanced\" governor.\n") # deploy cpufreqctl script func call cpufreqctl() diff --git a/bin/auto-cpufreq b/bin/auto-cpufreq index d149c02..e01ab40 100755 --- a/bin/auto-cpufreq +++ b/bin/auto-cpufreq @@ -177,10 +177,9 @@ def main(config, daemon, debug, install, install_performance, live, log, monitor elif install_performance: if os.getenv("PKG_MARKER") == "SNAP": root_check() - print("This option is only available on non Snap installs" - "Please refer to: power_helper.py script for more info\n") + print("This option is only available on non Snap installs\n" + "Please refer to auto-cpufreq power_helper.py script for more info\n") else: - print("in performance") root_check() running_daemon() gov_check() @@ -198,7 +197,6 @@ def main(config, daemon, debug, install, install_performance, live, log, monitor run("snapctl start --enable auto-cpufreq", shell=True) deploy_complete_msg() else: - print("in install") root_check() running_daemon() gov_check()