cawbird icon indicating copy to clipboard operation
cawbird copied to clipboard

Cawbird notifications should use app icon and show app name

Open txtsd opened this issue 4 years ago • 3 comments

Describe the bug When using the notification daemon dunst, Cawbird notifications show up with a generic notification icon instead of the app icon, and there is no app name in the notification.

To Reproduce Steps to reproduce the behavior:

  1. Install dunst and run it
  2. Receive a notification from Cawbird
  3. See the generic icon and missing app name

Expected behavior The icon should be Cawbird's icon, and the app's name should show in the notification

Screenshots The app name usually appears before the colon in my config. Here it is empty. 2021-05-02-194224_1920x1080_scrot

System details:

  • OS: Arch Linux
  • Version: 1.4
  • Package type: Official Arch repos

Additional context

txtsd avatar May 02 '21 14:05 txtsd

We use GLib.Notification and GLib.Application.send_notification() for the notifications, which sends DBus messages and provides an ID etc.

As far as I can tell, there's no way to set an application name. It's just not part of the API. Gnome (and presumably some other desktop environments, based on what I've seen) pull the name and icon from the .desktop file.

We could set an icon for all of those DEs/notification systems that can't find it themselves. But it seems a bit wasteful and prone to other problems if we ship the icon with each message rather than letting the DE pick the appropriately scaled icon etc

Edit: Just used dbus-monitor to pick out this message:

method call time=1619968762.925961 sender=:1.803 -> destination=org.gtk.Notifications serial=135 path=/org/gtk/Notifications; interface=org.gtk.Notifications; member=AddNotification
   string "uk.co.ibboard.cawbird"
   string "47304773-tweet-1388875395211137029"
   array [
      dict entry(
         string "title"
         variant             string ""Test & Account" with a long name tweeted"
      )
      dict entry(
         string "body"
         variant             string "D'oh. We hide our own mentions."
      )
      dict entry(
         string "priority"
         variant             string "normal"
      )
      dict entry(
         string "default-action"
         variant             string "app.show-window"
      )
      dict entry(
         string "default-action-target"
         variant             int64 47304773
      )
   ]

I'll look at it more later and map it to the spec.

IBBoard avatar May 02 '21 15:05 IBBoard

I managed to use Dunst to replace the icon with one I want. The app name, however, is up to you. It'll be nice to have Cawbird work well outside of a DE.

txtsd avatar May 02 '21 18:05 txtsd

It looks like it's a limitation of GLib's GNotification. We would need to swap to libnotify to pass an app name. But that would also enable us to do #277, so it will probably happen at some point.

IBBoard avatar May 06 '21 17:05 IBBoard