I am using Unity’s launcher count API to show temperature from an weather app in the launcher.
When the temperature is negative, KDE just shows a -ve sign.
In comparison, Plank dock shows the correct number.
Here is a minimalistic example to recreate the issue. Save this python script, and run it. It should change the launcher count of firefox, and add a badge of -10. But the badge will only show up as “-”.
import dbus
import dbus.service
import dbus.mainloop.glib
from gi.repository import GObject
class Service(dbus.service.Object):
def __init__(self, message):
self._message = message
def run(self):
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus_name = dbus.service.BusName("com.example.service", dbus.SessionBus())
dbus.service.Object.__init__(self, bus_name, "/com/example/service")
self._loop = GObject.MainLoop()
GObject.idle_add(lambda: self.Update("application://firefox.desktop", {"count-visible": True, "count": dbus.Int64(-7)}))
self._loop.run()
@dbus.service.signal(dbus_interface="com.canonical.Unity.LauncherEntry", signature='sa{sv}')
def Update(self, app_uri, properties):
print(app_uri, properties)
if __name__ == "__main__":
Service("This is the service").run()
I would be happy to open a bug report. But I am not sure which project I should report it against. Any tips?