Added custom tz support to eww clocks

~/.config/eww/displaytime, if it exists, should be a symlink to a
timezone file (like /etc/localtime). When set, clocks will use this
timezone instead of system time. The large sidebar clock will show
the timezone name when the timezone used was not read from /etc/localtime.
This commit is contained in:
2026-01-23 10:29:24 -07:00
parent d55a8a4d0d
commit e44618391b
8 changed files with 424 additions and 35 deletions

View File

@@ -9,6 +9,9 @@ import sys
PRIORITY_PLAYERS = {"Feishin"}
# Override the reported album if the URL is in this dict
URL_ALBUM_OVERRIDES = {"https://distantworlds3.space/radio/": "Distant Radio"}
class MprisMonitor(Gio.Application):
"""MPRIS monitor application."""
@@ -98,7 +101,10 @@ class MprisMonitor(Gio.Application):
== Mpris.PlaybackStatus.PLAYING,
"title": player.props.title,
"artist": player.props.artist,
"album": player.props.album,
"album": URL_ALBUM_OVERRIDES.get(
player.props.metadata.unpack().get("xesam:url", ""),
player.props.album,
),
"album_artist": player.props.album_artist,
"position": player.props.position,
"position_minutes": int((player.props.position) // 60),