Misc fixes
This commit is contained in:
parent
0d1c2f1975
commit
22b844df2c
3 changed files with 75 additions and 71 deletions
|
@ -874,7 +874,7 @@ class MprisProvider(Section, ThreadedUpdater):
|
|||
"{{ playerName }} {{ status }}",
|
||||
"{{ album }}",
|
||||
"{{ artist }}",
|
||||
"{{ duration(position) }}|{{ duration(mpris:length) }}" " {{ title }}",
|
||||
"{{ duration(position) }}/{{ duration(mpris:length) }}" " {{ title }}",
|
||||
]
|
||||
|
||||
# nf-fd icons don't work (UTF-16?)
|
||||
|
@ -894,6 +894,8 @@ class MprisProvider(Section, ThreadedUpdater):
|
|||
3: "",
|
||||
}
|
||||
|
||||
MAX_SECTION_LENGTH = 40
|
||||
|
||||
def __init__(self, theme: int | None = None):
|
||||
ThreadedUpdater.__init__(self)
|
||||
Section.__init__(self, theme)
|
||||
|
@ -926,6 +928,8 @@ class MprisProvider(Section, ThreadedUpdater):
|
|||
if text:
|
||||
if i in self.ICONS:
|
||||
text = f"{self.ICONS[i]} {text}"
|
||||
if len(text) > self.MAX_SECTION_LENGTH:
|
||||
text = text[: self.MAX_SECTION_LENGTH - 1] + "…"
|
||||
section.updateText(text)
|
||||
else:
|
||||
section.updateText(None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue