Nvm, I managed to get it to work. For some reason import org.kde.plasma.workspace.dbus when used without DBus namespace (just unit32 and SessionBus ) doesn’t work, but namespacing import org.kde.plasma.workspace.dbus as DBus along with DBus.SessionBusand DBus.unit32 works.