Skip to content

Commit

Permalink
mpris module: add player_shortname placeholder for displaying player …
Browse files Browse the repository at this point in the history
…busname (ultrabug#2120)
  • Loading branch information
valdur55 authored Apr 22, 2022
1 parent bcf0685 commit e4a0048
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions py3status/modules/mpris.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
{artist} artiste name (first one)
{length} time duration of the song
{player} show name of the player
{player_shortname} show name of the player from busname (usually command line name)
{state} playback status of the player
{time} played time of the song
{title} name of the song
Expand Down Expand Up @@ -136,21 +137,24 @@ def __init__(
self._id = player_id
self.parent = parent
self._name_with_instance = name_with_instance
self._player_name = identity
self._identity = identity
self._identity_index = identity_index
self._name_priority = name_priority
self._metadata = {}
self._can = {}
self._buttons = {}
self._properties_changed_match = None
self._state = None
self._name = name_from_id
self._player_shortname = name_from_id
self._dPlayer = dPlayer(dbus_interface_info={"dbus_uri": player_id})
self._full_name = f"{self._player_name} {self._identity_index}"
self._hide_non_canplay = self._name in self.parent.player_hide_non_canplay
self._full_name = f"{self._identity} {self._identity_index}"
self._hide_non_canplay = (
self._player_shortname in self.parent.player_hide_non_canplay
)

self._placeholders = {
"player": self._player_name,
"player": self._identity,
"player_shortname": self._player_shortname,
# for debugging ;p
"full_name": self._full_name,
}
Expand Down

0 comments on commit e4a0048

Please sign in to comment.