From 728643efaf9da277695f6e583c7b1fadc3da94bd Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 24 Mar 2026 19:21:09 -0700 Subject: [PATCH] feat:mpris Add the mpris bus-name as property Feature I like to implement in my mpris monitor is syncing the last used and still existing mpris name to `/run/$UID/mpris_last_active` so that media keybinds can use `playerctl` for simple controls on the last player used (ex. stopping spotify to play a youtube video, then after the video is done, spotify would be the last available and the next media control should route there). --- ignis/services/mpris/player.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ignis/services/mpris/player.py b/ignis/services/mpris/player.py index 857ece3b..9afcb45c 100644 --- a/ignis/services/mpris/player.py +++ b/ignis/services/mpris/player.py @@ -15,9 +15,10 @@ class MprisPlayer(IgnisGObject): A media player object. """ - def __init__(self, mpris_proxy: DBusProxy, player_proxy: DBusProxy): + def __init__(self, name: str, mpris_proxy: DBusProxy, player_proxy: DBusProxy): super().__init__() + self.name = name self.__mpris_proxy = mpris_proxy self.__player_proxy = player_proxy self._conn_mgr = ConnectionManager() @@ -79,7 +80,7 @@ async def new_async(cls, name: str) -> "MprisPlayer": info=utils.load_interface_xml("org.mpris.MediaPlayer2.Player"), ) - obj = cls(mpris_proxy=mpris_proxy, player_proxy=player_proxy) + obj = cls(name=name, mpris_proxy=mpris_proxy, player_proxy=player_proxy) await obj._initial_sync() return obj