Actually a digital readout is useful
This commit is contained in:
parent
385ea67efd
commit
4e13e22dee
1 changed files with 13 additions and 14 deletions
|
@ -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"),
|
||||||
|
|
Loading…
Reference in a new issue