hoodie / notify-rust

☝️send desktop notifications from your Rust app.
Apache License 2.0
1.17k stars 74 forks source link

Change notification icon size #31

Closed tforgione closed 7 years ago

tforgione commented 7 years ago

Hi,

thanks for this awesome library !

I was wondering if it was possible to change the size of the icon like so for example

Notification::new()
    .summary("Hello")
    .body("How are you")
    .icon("/path/to/icon.png")
    .icon_size(128) // change the size of the icon
    .show()
    .unwrap();
hoodie commented 7 years ago

I haven't tried this specifically, but I don't think the standard mentions this. Besides the implementations vary from kde to gnome to unity etc. From what I know in kde and gnome they are being resized automatically. We might want to consult @h4llow3En about the macOS possibilities

kiliankoe commented 7 years ago

There's nothing here for macOS, the image size is set by the system and can't be changed.

hoodie commented 7 years ago

Seems like there is not much we can do on the client side. I'll link the major specifications here, just as a reference. If somebody finds something I'd love a PR though :D http://www.galago-project.org/specs/notification/0.9/index.html https://developer.gnome.org/notification-spec/ https://wiki.ubuntu.com/NotifyOSD

h4llow3En commented 7 years ago

Yes the icon size on macOS is fixed, as @kiliankoe mentioned before

tforgione commented 7 years ago

I see, personally, I use Awesome Window Manager, and it comes with an API that let you choose the size of the icon in the notification, but I understand that it's far from the standard.

In fact, I don't know how notifications work on other desktop managers, but on Awesome WM, if the image of the icon is 500x500, the size of the image in the notification will be the same, and so, it'll take half my screen, and that's what I want to avoid.

If the icon size is not specified in the standard, maybe I should not try to solve my problem in this, but in the configuration of my Awesome WM.

Anyways, thank you for taking time to answer my questions !