From 79d7dacd4fb9f06976fc5e5f4f4593e7051e2f1d Mon Sep 17 00:00:00 2001 From: Baitinq <30861839+Baitinq@users.noreply.github.com> Date: Tue, 21 Dec 2021 23:29:20 +0000 Subject: Update the daypercentage module to fix bug and use python --- modules/daypercentage.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 modules/daypercentage.py (limited to 'modules/daypercentage.py') diff --git a/modules/daypercentage.py b/modules/daypercentage.py new file mode 100755 index 0000000..d97d6d8 --- /dev/null +++ b/modules/daypercentage.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +PREFIX = ' ' + +import datetime + +now = datetime.datetime.now() +minutes = now.hour * 60 + now.minute +percentage = round(minutes * 100 / 1440) + +print(PREFIX + str(percentage) + "%") -- cgit v1.2.3