Skip to content

player-mpris-tail.py does not print icon-none on startup. #389

@takase1121

Description

@takase1121

The script doesn't display anything when no player is connected initially.
--icon-none will only be displayed after at least one player has connected and disconnected, as the code responsible for it is put in removePlayer().

I currently have this workaround to make it work:

--- /usr/share/polybar/scripts/player-mpris-tail.py	2022-09-16 13:04:47.000000000 +0800
+++ player-mpris-tail.py	2022-09-17 19:48:07.365836908 +0800
@@ -30,6 +30,8 @@
         self.connected = False
         self.player_states = {}
 
+        _printFlush(ICON_NONE)
+
         self.refreshPlayerList()
 
         if self._connect:

If this is the correct way, I can PR it.
If it's wrong and there's already some magical polybar way to do it, please point me to it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions