Hello Kotlin Community! :wave: Introducing Deskto...
# feed
u
Hello Kotlin Community! 👋 Introducing DesktopNotifyKT - a lightweight library with a powerful DSL for native desktop notifications on Windows, macOS, and Linux.
Copy code
val notification = notification(
    title = "Hello from Compose",
    message = "This notification has Compose UI elements as its images",
    largeIcon = {
        // Your Composable UI for large image here
    },
    smallIcon = {
        // Your Composable UI for small icon here
    },
    onActivated = { println("Notification 1 activated")
) {
    button(title = "Button 1") {
        println("Button 1 from Screen 1 clicked")
    }
    button(title = "Button 2") {
        println("Button 2 from Screen 1 clicked")
    }
}

// Send the notification
notification.send()
Features : - Expressive DSL: Define rich notifications with a clean, declarative syntax - Interactive Elements : Add buttons and actions with minimal boilerplate - Callback Support: Handle notification events with simple lambda expressions - Compose Integration: Use Composable UI elements as notification images - Cross-Platform: Windows, macOS, and Linux support https://github.com/kdroidFilter/DesktopNotifyKT
🎉 3
K 6
kodee loving 4
K 2
👍 10
s
This looks very useful and I’ll definitely try it when I have the need for a Desktop notification. 🙂 Thank you for sharing it with us! 🙏🏻
❤️ 2
💯 1
u
I think it should be possible to use it with https://github.com/kevincianfarini/cardiologist to schedule notifications
But I haven't checked yet, I could perhaps write a .schedule function based on this library