fix: formating issues in prompt
Some checks are pending
Continuous Integration / Checks (push) Waiting to run

This commit is contained in:
Tim Schubert 2024-12-27 15:30:19 +01:00
parent 835bd775ae
commit 4e869e2cf0
Signed by: dadada
SSH key fingerprint: SHA256:bFAjFH3hR8zRBaJjzQDjc3o4jqoq5EZ87l+KXEjxIz0

View file

@ -23,7 +23,7 @@ class Cat(Status):
def status(self): def status(self):
cat_width = 200 cat_width = 200
index = self.index index = self.index
catwalk = " " * (cat_width - index) + 1 * "🐈🏳️‍🌈" + " " * index catwalk = "🐈🏳️‍🌈" + " " * index
self.index = (index + 1) % cat_width self.index = (index + 1) % cat_width
return {"full_text": catwalk} return {"full_text": catwalk}
@ -71,7 +71,17 @@ class Battery(Status):
class Time(Status): class Time(Status):
def status(self): def status(self):
return {"full_text": datetime.now().strftime("%Vth %A %H:%M") } now = datetime.now()
match now.isocalendar().week % 10:
case 1:
th = "st"
case 2:
th = "nd"
case 3:
th = "rd"
case _:
th = "th"
return {"full_text": now.strftime(f"%V{th} %A %H:%M") }
class FailedUnits(Status): class FailedUnits(Status):
@ -82,7 +92,7 @@ class FailedUnits(Status):
for line in stdout: for line in stdout:
if 'failed' in line: if 'failed' in line:
failed += 1 failed += 1
if failed is 0: if failed == 0:
return {"full_text": f"No failed units"} return {"full_text": f"No failed units"}
else: else:
return {"full_text": f"There are {failed} failed units", "color": "#ff0000"} return {"full_text": f"There are {failed} failed units", "color": "#ff0000"}