Actually a digital readout is useful

This commit is contained in:
M1dgard 2018-05-20 23:44:30 +02:00
parent 385ea67efd
commit 4e13e22dee
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -26,20 +26,20 @@ try:
minute = minutehands[ t.minute // 5 ] minute = minutehands[ t.minute // 5 ]
hour = hourhands [ t.hour % 12 ] hour = hourhands [ t.hour % 12 ]
return "%{F000}%{O-24}" + hour + "%{O-24}" + minute return color_for(t) + "%{T8}%{F#000}%{O-24}" + hour + "%{O-24}" + minute + "%{T-}%{F}"
def color_for(t): def color_for(t):
if t.hour < 5 or t.hour > 22: if t.hour < 5 or t.hour > 22:
return "888" return "%{F#888}"
elif t.hour < 10: elif t.hour < 10:
return "DB9" return "%{F#DB9}"
elif t.hour < 14: elif t.hour < 14:
return "DDB" return "%{F#DDB}"
elif t.hour < 19: elif t.hour < 19:
return "DDD" return "%{F#DDD}"
else: else:
return "D9B" return "%{F#D9B}"
while True: while True:
@ -47,22 +47,21 @@ try:
localnow = datetime.now() localnow = datetime.now()
leftnow = utcnow.astimezone(tzleft ) leftnow = utcnow.astimezone(tzleft )
rightnow = utcnow.astimezone(tzright) rightnow = utcnow.astimezone(tzright)
localcolor = color_for(localnow)
print( print(
localnow.strftime("%A") + localnow.strftime("%A") +
" " + " " +
"%{T8}%{F#" + color_for(leftnow) + "}" +
face_for(leftnow) + face_for(leftnow) +
"%{F}%{T-}" +
" %{F"+color_for(localnow)+"}" + " %{T4}" + localcolor + localnow.strftime("%H") +
# "%{T4}" + localnow.strftime("%H:%M") + "%{T-}" + "%{O2}%{T8}" + face_for(localnow) +
"%{T8}" + face_for(localnow) + "%{T-}" + "%{O2}%{T4}" + localcolor + localnow.strftime("%M") + "%{T-}" +
"%{F} " + " " +
"%{T8}%{F#" + color_for(rightnow) + "}" +
face_for(rightnow) + face_for(rightnow) +
"%{F}%{T-}" +
" " + " " +
localnow.strftime("%d %b"), localnow.strftime("%d %b"),