From 2d0cd34db6f2d45e83957ce79e4ce55e858a914c Mon Sep 17 00:00:00 2001 From: Sheppy Date: Mon, 30 Apr 2018 03:45:19 +0200 Subject: [PATCH] b counter --- herbstluftwm/hl_panel_content.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/herbstluftwm/hl_panel_content.py b/herbstluftwm/hl_panel_content.py index 7e9f7ec..118014d 100755 --- a/herbstluftwm/hl_panel_content.py +++ b/herbstluftwm/hl_panel_content.py @@ -3,6 +3,7 @@ import hl_utils from hl_constants import * import string import re +from datetime import datetime def guthaben(): guthaben = '' @@ -53,5 +54,15 @@ def logins(): except: return "" +def countdown(): + delta = datetime(year=2018,month=7,day=22,hour=20) - datetime.now() + if delta.days > 1: + tmp = "{} von 180 Tagen bis Abgabe verbleibend".format(delta.days) + else: + tmp = "{}h bis BC Abgabe".format(delta.hours) + tmp = hl_utils.color_panel(tmp,YELLOW) + return tmp + + if __name__ == "__main__": - print(logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='') + print(countdown(),logins(),ip(),vpn(),guthaben(),battery(),date(),sep='',end='')