diff --git a/polybar/spotify/py_spotify_listener.py b/polybar/spotify/py_spotify_listener.py index e960411..a1b47b8 100755 --- a/polybar/spotify/py_spotify_listener.py +++ b/polybar/spotify/py_spotify_listener.py @@ -3,11 +3,12 @@ # License: GPL3+ """Receiver related functionality.""" import dbus.service -import dbus.glib +from dbus.mainloop.glib import DBusGMainLoop from os import system -from gi.repository import GObject +from gi.repository import GLib import dbus +DBusGMainLoop(set_as_default=True) class Test(dbus.service.Object): """Reciever test class.""" @@ -68,6 +69,7 @@ def event_handler(*args, **kwargs): system("polybar-msg hook playpause 3") """ Send IPC hook 2 to all bars for module spotify """ system("polybar-msg hook spotify 2") + #system("polybar-msg action spotify 2") def unwrap(val): if isinstance(val, dbus.ByteArray): @@ -86,7 +88,7 @@ def unwrap(val): return bytes([int(val)]) return val -loop = GObject.MainLoop() +loop = GLib.MainLoop() """ First we get the bus to attach to. This may be either the session bus, of the