use portals for linux notifs
This commit is contained in:
parent
c0d14ac30e
commit
deaf564c36
6 changed files with 43 additions and 22 deletions
|
|
@ -3,8 +3,6 @@ import "dart:io";
|
||||||
import "package:material_ui/material_ui.dart";
|
import "package:material_ui/material_ui.dart";
|
||||||
import "package:nexus/main.dart";
|
import "package:nexus/main.dart";
|
||||||
import "package:flutter_local_notifications/flutter_local_notifications.dart";
|
import "package:flutter_local_notifications/flutter_local_notifications.dart";
|
||||||
// ignore: implementation_imports
|
|
||||||
import "package:flutter_local_notifications_linux/src/model/hint.dart";
|
|
||||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
import "package:nexus/pages/notifications.dart";
|
import "package:nexus/pages/notifications.dart";
|
||||||
|
|
||||||
|
|
@ -91,14 +89,9 @@ class NotificationController
|
||||||
largeIcon: icon == null ? null : FilePathAndroidBitmap(icon.path),
|
largeIcon: icon == null ? null : FilePathAndroidBitmap(icon.path),
|
||||||
),
|
),
|
||||||
linux: .new(
|
linux: .new(
|
||||||
customHints: icon == null
|
category: LinuxNotificationCategory.imReceived,
|
||||||
? null
|
defaultActionName: "app.event",
|
||||||
: [
|
icon: icon == null ? null : FilePathLinuxIcon(icon.path),
|
||||||
.new(
|
|
||||||
name: "image-path",
|
|
||||||
value: LinuxHintStringValue(icon.path),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
// TODO: See if icons can be added to iOS, macOS, and Windows notifications (#68)
|
// TODO: See if icons can be added to iOS, macOS, and Windows notifications (#68)
|
||||||
iOS: .new(),
|
iOS: .new(),
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,7 @@ Icon=nexus
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Chat;Network;InstantMessaging;
|
Categories=Chat;Network;InstantMessaging;
|
||||||
MimeType=x-scheme-handler/nexus.federated.nexus;
|
MimeType=x-scheme-handler/nexus.federated.nexus;
|
||||||
|
StartupNotify=true
|
||||||
|
DBusActivatable=true
|
||||||
|
X-GNOME-UsesNotifications=true
|
||||||
3
linux/nexus.federated.nexus.service
Normal file
3
linux/nexus.federated.nexus.service
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[D-BUS Service]
|
||||||
|
Name=nexus.federated.nexus
|
||||||
|
Exec=/usr/bin/env FLUTTER_HEADLESS=1 nexus
|
||||||
|
|
@ -34,6 +34,8 @@ flutter.buildFlutterApplication {
|
||||||
navigation_rail_m3e = "sha256-+2awDTQnK58gGRY1nuHckG/jjxarsYSRu9ovR4i4TEc=";
|
navigation_rail_m3e = "sha256-+2awDTQnK58gGRY1nuHckG/jjxarsYSRu9ovR4i4TEc=";
|
||||||
unifiedpush_linux = "sha256-aIF/8oabSuuZo7K6qr4r7UBmf57qgoGAXyJ40fdntuQ=";
|
unifiedpush_linux = "sha256-aIF/8oabSuuZo7K6qr4r7UBmf57qgoGAXyJ40fdntuQ=";
|
||||||
unifiedpush_platform_interface = "sha256-aIF/8oabSuuZo7K6qr4r7UBmf57qgoGAXyJ40fdntuQ=";
|
unifiedpush_platform_interface = "sha256-aIF/8oabSuuZo7K6qr4r7UBmf57qgoGAXyJ40fdntuQ=";
|
||||||
|
flutter_local_notifications_linux = "sha256-I1X+Taw4+hxDHOUxCcqiWoJbZJqbrdVUXUC0vj1Adjc=";
|
||||||
|
flutter_local_notifications_platform_interface = "sha256-I1X+Taw4+hxDHOUxCcqiWoJbZJqbrdVUXUC0vj1Adjc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
|
|
||||||
32
pubspec.lock
32
pubspec.lock
|
|
@ -497,19 +497,21 @@ packages:
|
||||||
flutter_local_notifications_linux:
|
flutter_local_notifications_linux:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_local_notifications_linux
|
path: flutter_local_notifications_linux
|
||||||
sha256: "9ca97e63776f29ab1b955725c09999fc2c150523269db150c39274f2a43c5a8b"
|
ref: "quad/feat/xdg-portal-notifs"
|
||||||
url: "https://pub.dev"
|
resolved-ref: d853ff4997f6dd2b9ecdc53d37fb337cebe63863
|
||||||
source: hosted
|
url: "https://github.com/Henry-Hiles/flutter_local_notifications"
|
||||||
version: "8.0.1"
|
source: git
|
||||||
|
version: "9.0.0-dev.1"
|
||||||
flutter_local_notifications_platform_interface:
|
flutter_local_notifications_platform_interface:
|
||||||
dependency: transitive
|
dependency: "direct overridden"
|
||||||
description:
|
description:
|
||||||
name: flutter_local_notifications_platform_interface
|
path: flutter_local_notifications_platform_interface
|
||||||
sha256: "43c3761d916c9bd3d5c7ebbc44d82f4990329840c0c5d62ad5260cc1b5d399bd"
|
ref: "quad/feat/xdg-portal-notifs"
|
||||||
url: "https://pub.dev"
|
resolved-ref: d853ff4997f6dd2b9ecdc53d37fb337cebe63863
|
||||||
source: hosted
|
url: "https://github.com/Henry-Hiles/flutter_local_notifications"
|
||||||
version: "12.2.0"
|
source: git
|
||||||
|
version: "13.0.0-dev.1"
|
||||||
flutter_local_notifications_web:
|
flutter_local_notifications_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1742,6 +1744,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.2"
|
version: "0.5.2"
|
||||||
|
xdg_desktop_portal:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_desktop_portal
|
||||||
|
sha256: "4fae74b6ed63a449d4c796a74265cebdd912c390336dedc06d705142f3b939d7"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.14"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
10
pubspec.yaml
10
pubspec.yaml
|
|
@ -35,6 +35,16 @@ dependency_overrides:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/appelladev/linkify
|
url: https://github.com/appelladev/linkify
|
||||||
ref: fix/consecutive-periods-loose-url
|
ref: fix/consecutive-periods-loose-url
|
||||||
|
flutter_local_notifications_linux:
|
||||||
|
git:
|
||||||
|
url: https://github.com/Henry-Hiles/flutter_local_notifications
|
||||||
|
ref: quad/feat/xdg-portal-notifs
|
||||||
|
path: flutter_local_notifications_linux
|
||||||
|
flutter_local_notifications_platform_interface:
|
||||||
|
git:
|
||||||
|
url: https://github.com/Henry-Hiles/flutter_local_notifications
|
||||||
|
ref: quad/feat/xdg-portal-notifs
|
||||||
|
path: flutter_local_notifications_platform_interface
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue