From 775d11c963086a16f393a6d72345f19313a24601 Mon Sep 17 00:00:00 2001 From: Adnan Hodzic Date: Thu, 2 Jan 2020 02:10:51 +0100 Subject: [PATCH] added visual changes for deploy section --- auto-cpufreq.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/auto-cpufreq.py b/auto-cpufreq.py index e8231d1..6b70220 100755 --- a/auto-cpufreq.py +++ b/auto-cpufreq.py @@ -16,14 +16,13 @@ import click # ToDo: -# - add nice message at the end of deploy + add print for each action # - add parameter to read logs if daemon is set # - add option to disable bluetooth (only in daemon mode) # - add uninstall options for daemon # - sort out imports -# - make shortcut for platform # - go thru all other ToDo's +# - make shortcut for platform # - fill out every TBU (cli + auto-cpufreq.service file) # - add readme + list need to install all necessary packages @@ -46,23 +45,28 @@ bat_state = p.sensors_battery().power_plugged # get CPU utilization as a percentage cpuload = p.cpu_percent(interval=1) +# deploy auto-cpufreq daemon def deploy(): + print("\n" + "-" * 21 + " Deploying auto-cpufreq as a daemon " + "-" * 22 + "\n") + # deploy cpufreqctl script (if missing) if os.path.isfile("/usr/bin/cpufreqctl"): pass else: + print("\n* Addding missing \"cpufreqctl\" script") os.system("cp scripts/cpufreqctl.sh /usr/bin/cpufreqctl") - # deploy auto-cpufreq binary + print("\n* Deploy auto-cpufreq as system wide accessible binary") os.system("cp auto-cpufreq.py /usr/bin/auto-cpufreq") - # deploy auto-cpufreq daemon script + print("\n* Deploy auto-cpufreq daemon deploy script") os.system("cp scripts/auto-cpufreq-daemon.sh /usr/bin/auto-cpufreq-daemon") - # create auto-cpufreq systemd unit file + print("\n* Deploy auto-cpufreq systemd unit file") os.system("cp scripts/auto-cpufreq.service /lib/systemd/system/auto-cpufreq.service") + # run auto-cpufreq daemon deploy script s.call("/usr/bin/auto-cpufreq-daemon", shell=True) # ToDo: disable bluetooth on boot