diff --git a/ansible/roles/sway/files/style.css b/ansible/roles/sway/files/style.css index bc42938..1ccc260 100644 --- a/ansible/roles/sway/files/style.css +++ b/ansible/roles/sway/files/style.css @@ -95,6 +95,9 @@ font-weight: bold; } +#custom-clock { +} + #cpu { /* No styles */ } diff --git a/ansible/roles/sway/files/waybar_custom_clock.py b/ansible/roles/sway/files/waybar_custom_clock.py index a8d499d..d42ca54 100644 --- a/ansible/roles/sway/files/waybar_custom_clock.py +++ b/ansible/roles/sway/files/waybar_custom_clock.py @@ -40,7 +40,7 @@ class Update: @lru_cache(maxsize=1) -def make_calendar(today: datetime.date): +def make_calendar(today: datetime.date, tz: datetime.tzinfo): width: Final[int] = 20 start_of_month = today.replace(day=1) month_header = today.strftime("%B %Y") @@ -50,6 +50,8 @@ def make_calendar(today: datetime.date): header = f"{left_padding}{month_header}{right_padding}" days_of_week = "Su Mo Tu We Th Fr Sa" + timezone_str = str(tz) + # Make the grid first_day_padding = " " * ( 0 if start_of_month.weekday() == 6 else (3 * (1 + start_of_month.weekday())) - 1 @@ -63,11 +65,13 @@ def make_calendar(today: datetime.date): else: output += " " if print_day == today: - output += '' + output += '' output += f"{print_day.day: >2}" if print_day == today: output += "" print_day += datetime.timedelta(days=1) + + output += f'\n{timezone_str}' return output @@ -87,7 +91,7 @@ def main(): now = datetime.datetime.now(tz=tz) text = now.strftime("%Y-%m-%d %H:%M") - tooltip = make_calendar(now.date()) + tooltip = make_calendar(now.date(), tz) out = Update( text=text,