added refresh countdown

This commit is contained in:
Adnan Hodzic 2019-12-31 00:37:54 +01:00
parent 4949160a96
commit 852c2f7171
1 changed files with 12 additions and 2 deletions

View File

@ -20,7 +20,6 @@ import click
# - add option to enable turbo in powersave
# - go thru all other ToDo's
# - copy cpufreqctl script if it doesn't exist
# - add refresh timeout message (how to quit?)
# global var
p = psutil
@ -55,6 +54,16 @@ def root_check():
sys.exit(f"Must be run as root, i.e: \"sudo {tool_run}\"\n")
exit(1)
# refresh countdown
def countdown(s):
for remaining in range(s, 0, -1):
sys.stdout.write("\r")
sys.stdout.write("\"auto-cpufreq\" refresh in:{:2d}".format(remaining))
sys.stdout.flush()
time.sleep(1)
sys.stdout.write("\rRefreshing ... \n")
# set powersave
def set_powersave():
print("\nSetting: powersave")
@ -171,7 +180,8 @@ def cli(live, daemon):
gov_check()
sysinfo()
autofreq()
time.sleep(10)
countdown(15)
#time.sleep(1)
subprocess.call("clear")
elif daemon:
print("daemon ...")