diff --git a/bin/auto-cpufreq b/bin/auto-cpufreq index ccd8773..c2eed66 100755 --- a/bin/auto-cpufreq +++ b/bin/auto-cpufreq @@ -35,6 +35,7 @@ def main(monitor, live, daemon, install, log, debug): if os.getenv("PKG_MARKER") == "SNAP" and dcheck == "enabled": while True: root_check() + footer() gov_check() cpufreqctl() distro_info() @@ -90,9 +91,11 @@ def main(monitor, live, daemon, install, log, debug): root_check() footer() distro_info() + print("") if os.getenv('PKG_MARKER') == "SNAP": print("Snap package: yes") else: + app_version() print("Snap package: no") print("") python_info() diff --git a/source/core.py b/source/core.py index 3aa50c7..e87341b 100644 --- a/source/core.py +++ b/source/core.py @@ -12,7 +12,7 @@ import warnings from math import isclose from pathlib import Path from pprint import pformat -from subprocess import getoutput, call, run +from subprocess import getoutput, call, run, check_output import psutil import distro @@ -30,6 +30,9 @@ SCRIPTS_DIR = Path("/usr/local/share/auto-cpufreq/scripts/") ALL_GOVERNORS = ("performance", "ondemand", "conservative", "schedutil", "userspace", "powersave") CPUS = os.cpu_count() +# ToDo: read version from snap/snapcraft.yaml and write to $SNAP/version for use with snap installs +def app_version(): + print("Build git commit:", check_output(["git", "describe", "--always"]).strip().decode()) def turbo(value: bool = None): """