{"id":29475299,"url":"https://github.com/kdroidfilter/desktopnotifykt","last_synced_at":"2025-10-13T08:38:32.662Z","repository":{"id":258694542,"uuid":"866393006","full_name":"kdroidFilter/DesktopNotifyKT","owner":"kdroidFilter","description":"The DesktopNotifyKT is a Kotlin JVM library that enables developers to add notifications to their desktop applications in a unified way across different platforms, including Windows, macOS and Linux.","archived":false,"fork":false,"pushed_at":"2025-09-24T18:38:13.000Z","size":3826,"stargazers_count":117,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-24T20:29:05.387Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdroidFilter.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-02T07:15:29.000Z","updated_at":"2025-09-24T18:37:38.000Z","dependencies_parsed_at":"2025-04-28T17:32:45.465Z","dependency_job_id":"fb6cdc16-fb4d-43fa-9065-afea7215a071","html_url":"https://github.com/kdroidFilter/DesktopNotifyKT","commit_stats":null,"previous_names":["kdroidfilter/knotify","kdroidfilter/composenativenotification","kdroidfilter/desktopnotify-kt"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kdroidFilter/DesktopNotifyKT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FDesktopNotifyKT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FDesktopNotifyKT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FDesktopNotifyKT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FDesktopNotifyKT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdroidFilter","download_url":"https://codeload.github.com/kdroidFilter/DesktopNotifyKT/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FDesktopNotifyKT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014319,"owners_count":26085492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-14T16:07:17.484Z","updated_at":"2025-10-13T08:38:32.657Z","avatar_url":"https://github.com/kdroidFilter.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DesktopNotify-KT\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/header.png\" alt=\"logo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://central.sonatype.com/artifact/io.github.kdroidfilter/knotify\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/io.github.kdroidfilter/knotify.svg?label=Maven%20Central\" alt=\"Maven Central\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey\" alt=\"Platform\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n## 🚀 Overview\n\n⚠️ **Warning**: This library is highly experimental, and bugs may occur. The API is subject to change.\n\nThis guide explains how to use the library in your KMP project.\n\n## 📦 Installation\n\nTo use this library, add the following dependency to your Kotlin project:\n\n```kotlin\nimplementation(\"io.github.kdroidfilter:knotify:\u003cversion\u003e\")\n```\n\n## ✨ Usage Example\n\nThe library uses a Kotlin DSL to define notifications in a declarative way, without the usual boilerplate code. Here are examples of how you can create and manage notifications:\n\n### Creating and Sending a Notification Later\n\n```kotlin\n// Create a notification\nval myNotification = notification(\n    title = \"Notification from Screen 1\",\n    message = \"This is a test notification from Screen 1\",\n    largeImage = Res.getUri(\"drawable/kdroid.png\"),\n    smallIcon = Res.getUri(\"drawable/small_icon.png\"),\n    onActivated = { Log.d(\"NotificationLog\", \"Notification 1 activated\") },\n    onDismissed = { reason -\u003e Log.d(\"NotificationLog\", \"Notification 1 dismissed: $reason\") },\n    onFailed = { Log.d(\"NotificationLog\", \"Notification 1 failed\") }\n) {\n    button(title = \"Show Message from Button 1\") {\n        Log.d(\"NotificationLog\", \"Button 1 from Screen 1 clicked\")\n        onShowMessage(\"Button 1 clicked from Screen 1's notification\")\n    }\n    button(title = \"Hide Message from Button 2\") {\n        Log.d(\"NotificationLog\", \"Button 2 from Screen 1 clicked\")\n        onShowMessage(null)\n    }\n}\n\n// Send it when needed\nmyNotification.send()\n\n```\n\n### Creating and Sending a Notification with Reference\n\n```kotlin\n// Send a notification immediately but keep a reference to it\nval myNotification = sendNotification(\n    title = \"Immediate Notification with Reference\",\n    message = \"This notification is sent immediately but can be manipulated later\",\n    smallIcon = Res.getUri(\"drawable/small_icon.png\"),\n    onActivated = { Log.d(\"NotificationLog\", \"Notification activated\") }\n) {\n    button(title = \"Click Me\") {\n        Log.d(\"NotificationLog\", \"Button clicked\")\n    }\n}\n\n// Hide it later when needed\nmyNotification.hide()\n```\n\nWith this DSL approach, you can create rich and interactive notifications while keeping the code clean and readable. The library handles all the necessary details, allowing you to focus on your app's core logic.\n\n\nThis code helps ensure that your app properly manages permissions, updating the notification state as permissions are granted or denied.\n\n### Configure optional parameters\n\nYou may need to set a default application name and icon for notifications.\n\n- Default application name is the first opened Window title or `\"Application\"` if there is no window or if it's title is an empty string.\n- Default is null so no icon will be displayed or must be defined for every notification.\n\nThe notification initialization can be done in the `main` function.\n\n```kotlin\nNotificationInitializer.configure(\n    AppConfig(\n        appName = \"My awesome app\",\n        smallIcon = Res.getUri(\"drawable/kdroid.png\"),\n    )\n)\n```\n\n## ⭐ Features\n\n- **Rich Interactive Notifications**: Use a Kotlin DSL to create rich notifications with multiple actions, images, and buttons.\n- **Callbacks for User Interaction**: Handle user actions such as `onActivated`, `onDismissed`, and `onFailed` to add interactivity to your notifications.\n- **Custom Actions**: Add buttons with custom actions to your notifications, such as showing or hiding messages.\n- **Button Support**: Notifications can include interactive buttons, allowing users to take specific actions directly from the notification.\n- **Cross-Platform Compatibility**: Seamless integration across Linux, Windows, and macOS with platform-specific considerations.\n\n## 🎨 KNotify Compose\n\nThis module extends the KNotify library to support Compose UI elements in notifications.\n\n### Features\n\n- Render Composable UI elements as notification images\n- Use the same familiar API as the core KNotify library\n- Seamlessly integrate your Compose UI with desktop notifications\n\n### Installation\n\nTo use the Compose extension, add the following dependency to your Kotlin project:\n\n```kotlin\nimplementation(\"io.github.kdroidfilter:knotify-compose:\u003cversion\u003e\")\n```\n\n### Usage\n\n```kotlin\n// Create a notification with Composable elements as the large image and small icon\nval notification = notification(\n    title = \"Hello from Compose\",\n    message = \"This notification has Compose UI elements as its images\",\n    largeIcon = {\n        // Your Composable UI for large image here\n        // For example, a blue circle with text \"KN\" in the center\n        // IMPORTANT: Always use modifier.fillMaxSize() for proper rendering\n        Box(modifier = Modifier.fillMaxSize()) {\n            // Your content here\n        }\n    },\n    smallIcon = {\n        // Your Composable UI for small icon here\n        // This will be rendered at a smaller size (typically 64x64)\n        // IMPORTANT: Always use modifier.fillMaxSize() for proper rendering\n        Box(modifier = Modifier.fillMaxSize()) {\n            // Your content here\n        }\n    }\n)\n\n// Send the notification\nnotification.send()\n\n// Or create and send in one step\nsendNotification(\n    title = \"Hello from Compose\",\n    message = \"This notification has Compose UI elements as its images\",\n    largeIcon = {\n        // Your Composable UI for large image here\n        // IMPORTANT: Always use modifier.fillMaxSize() for proper rendering\n        Box(modifier = Modifier.fillMaxSize()) {\n            // Your content here\n        }\n    },\n    smallIcon = {\n        // Your Composable UI for small icon here\n        // IMPORTANT: Always use modifier.fillMaxSize() for proper rendering\n        Box(modifier = Modifier.fillMaxSize()) {\n            // Your content here\n        }\n    }\n)\n```\n\n\u003e **Important Note**: When using Composable UI elements in notifications, always use `modifier.fillMaxSize()` to ensure proper rendering. Without this modifier, the content may not display correctly.\n\n## 📸 Screenshots\n\n### Windows\n![Windows](/assets/screenshots/Windows.png)\n\n### MacOS\n![MacOs](/assets/screenshots/MacOS.png)\n\n### Gnome (Linux)\n![Gnome](/assets/screenshots/Gnome.png)\n\n### KDE (Linux)\n![KDE](/assets/screenshots/KDE.png)\n\n\n## 📜 License\n\nThe DesktopNotify-KT Library is distributed under the [MIT License](LICENSE).\n\n## 🤝 Contributing\n\nIf you would like to contribute, feel free to submit issues or pull requests on the [GitHub repository](https://github.com/kdroidFilter/ComposeNativeNotification).\n\nFeel free to reach out for support or additional questions regarding implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdroidfilter%2Fdesktopnotifykt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdroidfilter%2Fdesktopnotifykt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdroidfilter%2Fdesktopnotifykt/lists"}