From 6a7e80ec3883eadc43cd0b4bbecfc99f7e76f257 Mon Sep 17 00:00:00 2001 From: Jo De Boeck Date: Tue, 22 Mar 2016 12:13:29 +0200 Subject: [PATCH] now_playing: use get_dbus_method for compatibility Calling method directly on dbus proxy object does not always work. --- i3pystatus/now_playing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/i3pystatus/now_playing.py b/i3pystatus/now_playing.py index bdb00e1..2ca27ea 100644 --- a/i3pystatus/now_playing.py +++ b/i3pystatus/now_playing.py @@ -69,7 +69,9 @@ class NowPlaying(IntervalModule): old_player = None def find_player(self): - players = [a for a in dbus.SessionBus().get_object("org.freedesktop.DBus", "/org/freedesktop/DBus").ListNames() if a.startswith("org.mpris.MediaPlayer2.")] + obj = dbus.SessionBus().get_object("org.freedesktop.DBus", "/org/freedesktop/DBus") + method = obj.get_dbus_method('ListNames', 'org.freedesktop.DBus') + players = [a for a in method() if a.startswith("org.mpris.MediaPlayer2.")] if self.old_player in players: return self.old_player if not players: