Open hayd opened 5 years ago
notify-rust allows data, path or a system image (if I am correct)?
Not sure about other libs but if this would be possible cross platform it would be awesome
On Linux, you specify an optional icon and an optional image. Both can be specified as file://...
URIs or as raw image data. You can also specify a standard name for the icon to use a native theme icon.
On macOS, you specify an app bundle identifier, so you can use any app’s icon, I guess. One can get the bundle identifier from an app name using mac_notification_sys::get_bundle_identifier("Some App Name")
mac_notification_sys
doesn’t support adding images by path or data, but the new, non-deprecated API allows to add images as “attachments”.
On Windows, you create XML to specify the notification. By default the app logo is used but you can do
<toast launch="app-defined-string">
<visual>
<binding template="ToastGeneric">
<text>Sample</text>
<text>This is a simple toast notification example</text>
<image placement="AppLogoOverride" src="some-url-or-path.png" />
</binding>
</visual>
...
</toast>
There’s a lot more possible on windows, including big banner-style images.
So in summary, the user should get the ability to specify both an icon and an image.
The icon can have
The image can have a path or image data and is only for linux and windows (unless we switch from mac_notification_sys
to something using the new macOS API)
So for macOS there is no way to provide image path? Only existing app icons?
see edit
I'm not sure what a cross platform API could look like for this.
it could be an enum rather than arbitrary images...