dbaelz
07/09/2021, 9:55 AMNotifier
and the experimental API with TrayState
. Both with 0.4.0
and 0.5.0-build225
.
fun main() = Window {
val notifier = Notifier()
val trayState = TrayState()
MaterialTheme {
Column {
Button(onClick = {
notifier.notify("Notification Notifier", "Hello there!")
}) { Text("Send via Notifier") }
Spacer(Modifier.height(8.dp))
Button(onClick = {
trayState.sendNotification(Notification("Notification TrayState", "Hello there!"))
}) {
Text("Send via TrayState")
}
}
}
}
olonho
07/09/2021, 9:58 AMRoman Sedaikin [JB]
07/09/2021, 10:05 AMIgor Demin
07/09/2021, 10:08 AMNotifier
just creates and removes temporary tray icon if there is no one; but it is a hack).
We can look how to send notifications bypassing Swing, probably just using the native API's for that. In theory sending just a plain text shouldn't be much of a problem.dbaelz
07/09/2021, 11:22 AMui-desktop
package. The Notifier uses SystemTray.isSupported()
which returns false as stated in the linked issue. So no wonder it didn't work 😉
I did experiment a little with the use of external programs like notify-send and will take a look into org.gnome.notify. For now not the most important topic (for me) on Compose Desktop. But would be great at some point.