Changing GObject to GLib

This commit is contained in:
Noah L. Schrick 2022-08-04 21:46:07 -05:00
parent 5240429733
commit 23f61ca999

View File

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