Fix clearing timer

master
Hektor Misplon 2023-12-09 21:29:04 +01:00
parent 07eec68706
commit df120d9fbb
1 changed files with 10 additions and 3 deletions

View File

@ -15,8 +15,9 @@ from time import sleep
from plyer import notification
@atexit.register
def clear():
os.system('echo -n "" > /tmp/pomo')
os.system('rm /tmp/pomo')
def format_mins_secs(mins, secs):
@ -36,8 +37,6 @@ def make_countdown():
def main(args):
atexit.register(clear)
prep_duration = args.prep_duration * 60
work_duration = args.work_duration * 60
break_duration = args.break_duration * 60
@ -59,7 +58,15 @@ def main(args):
repeats -= 1
def handle_signal(signal, frame):
# Wait for clear to finish
clear()
print('Exiting')
exit(0)
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('-p', '--prep-duration', type=int,