isamert / scli

a simple terminal user interface for signal messenger (using signal-cli)
GNU General Public License v3.0
439 stars 40 forks source link

Support notification pictures #159

Closed maximbaz closed 2 years ago

maximbaz commented 2 years ago

It would be very nice to be able to get a profile picture of the sender rendered in the notification, just like Signal Desktop does.

Here's what I recommend to consider:

  1. Find the path to sender's profile.

I can see some pics in ~/.local/share/signal-cli/avatars/contact-+<num> and ~/.local/share/signal-cli/avatars/profile-+<num>, not quite sure what's the difference, they seem to be somewhat duplicate, and I have more or contact- ones.

  1. If image is not found, use hardcoded value scli.

  2. Change default NOTIFICATION_COMMAND to be notify-send -i "%i" scli '%s - %m' (where %i is one of the two strings above)

This would achieve the following:

exquo commented 2 years ago

Nice suggestion, thanks! Should be a pretty low hanging fruit for us to implement, too.

I'm also not sure why some avatar files start with contact- and other with profile-. Asked upstream. In practice, scli can check existence for both, and use whichever it finds.

In addition to the steps you describe, we can add a 'generic icon name' fallback, using one of the stock icon names (like mail-message-new) from the freedesktop spec. I remember checking them for this purpose sometime back, but I guess I found them too "90s" looking :). And the users who really wanted a scli icon in notifications could add it in the --notification-command.

maximbaz commented 2 years ago

I agree, this is also a good approach to set default value to fallback to some existing icon!