diff --git a/.gitignore b/.gitignore index 2688f719..723f857d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,8 @@ app.*.map.json # Xcode build files ios/build + +# Flatpak build files +flatpak/.flatpak-builder +flatpak/build-dir +flatpak/lemmur-linux-*.tar.gz \ No newline at end of file diff --git a/README.md b/README.md index 0eef476d..a271ce8c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ A mobile client for [Lemmy](https://github.com/LemmyNet/lemmy) - a federated red - [Linux](#linux) - [Windows](#windows) - [FAQ](#faq) - - [Version x.x.x was released, why is it not yet on F-droid?](#version-xxx-was-released-why-is-it-not-yet-on-f-droid) + - [Version x.x.x was released, why is it not yet on F-droid/Flatpak?](#version-xxx-was-released-why-is-it-not-yet-on-f-droidflatpak) - ["App not installed" - what to do?](#app-not-installed---what-to-do) ## Build from source @@ -57,7 +57,7 @@ The executable will be in `build\windows\runner\Release\lemmur.exe` (be aware, h ## FAQ -### Version x.x.x was released, why is it not yet on F-droid? +### Version x.x.x was released, why is it not yet on F-droid/Flatpak? We have no control over F-droid's build process. This process is automatic and not always predictable in terms of time it takes. If a new version does not appear in F-droid a week after its release, then feel free to open an issue about it and we will look into it. diff --git a/flatpak/app_icon.svg b/flatpak/app_icon.svg new file mode 100644 index 00000000..0f5d6c82 --- /dev/null +++ b/flatpak/app_icon.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/flatpak/com.krawieck.lemmur.desktop b/flatpak/com.krawieck.lemmur.desktop new file mode 100644 index 00000000..eef3be5b --- /dev/null +++ b/flatpak/com.krawieck.lemmur.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Type=Application + +Name=Lemmur +Comment=A client for lemmy - a federated reddit alternative +Categories=Network;News;X-Social Media; + +Icon=com.krawieck.lemmur +Exec=lemmur +Terminal=false +StartupWMClass=lemmur \ No newline at end of file diff --git a/flatpak/com.krawieck.lemmur.json b/flatpak/com.krawieck.lemmur.json new file mode 100644 index 00000000..0aefb563 --- /dev/null +++ b/flatpak/com.krawieck.lemmur.json @@ -0,0 +1,68 @@ +{ + "app-id": "com.krawieck.lemmur", + "runtime": "org.freedesktop.Platform", + "runtime-version": "22.08", + "sdk": "org.freedesktop.Sdk", + "command": "lemmur", + "separate-locales": false, + "finish-args": [ + "--share=ipc", + "--socket=fallback-x11", + "--socket=wayland", + "--device=dri", + "--socket=pulseaudio", + "--share=network", + "--filesystem=xdg-download" + ], + "modules": [ + { + "name": "lemmur", + "buildsystem": "simple", + "only-arches": [ + "x86_64" + ], + "build-commands": [ + "ls lemmur", + "cp -r lemmur /app/lemmur", + "chmod +x /app/lemmur/lemmur", + "mkdir -p /app/bin", + "install -Dm644 ./app_icon.svg /app/share/icons/hicolor/scalable/apps/com.krawieck.lemmur.svg", + "ln -s /app/lemmur/lemmur /app/bin/lemmur", + "install -Dm644 com.krawieck.lemmur.desktop /app/share/applications/com.krawieck.lemmur.desktop", + "install -Dm644 com.krawieck.lemmur.metainfo.xml /app/share/appdata/com.krawieck.lemmur.metainfo.xml" + ], + "sources": [ + { + "type": "file", + "path": "com.krawieck.lemmur.metainfo.xml" + }, + { + "type": "file", + "path": "com.krawieck.lemmur.desktop" + }, + { + "type": "file", + "path": "app_icon.svg" + }, + { + "type": "archive", + "only-arches": [ + "x86_64" + ], + "url": "https://github.com/LemmurOrg/lemmur/releases/download/v0.8.0/lemmur-v0.8.0-x86_64-linux.tar.gz", + "dest": "lemmur", + "sha256": "47bbd7cc7ad2c4f036cd26ba552d2a17c786f0e834d214bf4cb1ab2395ec2079", + "strip-components": 0, + "x-checker-data": { + "type": "json", + "url": "https://api.github.com/repos/lemmurorg/lemmur/releases/latest", + "version-query": ".tag_name", + "url-query":".assets[] | select(.name==\"lemmur-\" + $version + \"-x86_64-linux.tar.gz\") | .browser_download_url" + } + } + + + ] + } + ] + } \ No newline at end of file diff --git a/flatpak/com.krawieck.lemmur.metainfo.xml b/flatpak/com.krawieck.lemmur.metainfo.xml new file mode 100644 index 00000000..7cea6392 --- /dev/null +++ b/flatpak/com.krawieck.lemmur.metainfo.xml @@ -0,0 +1,50 @@ + + + com.krawieck.lemmur + + Lemmur + A client for lemmy - a federated reddit alternative + + CC0-1.0 + GPL-2.0-only + + + pointing + keyboard + touch + + + Filip Krawczyk + https://github.com/LemmurOrg/lemmur + https://github.com/LemmurOrg/lemmur/issues + https://www.buymeacoffee.com/lemmur + https://weblate.join-lemmy.org/engage/lemmur + + + + Lemmur aims to provide a seamless experience when browsing different Lemmy instances. + + + You can have multiple multiple instances added at the same time without having to awkwardly switch between them. + + + + + + https://f-droid.org/repo/com.krawieck.lemmur/en-US/phoneScreenshots/1.png + https://f-droid.org/repo/com.krawieck.lemmur/en-US/phoneScreenshots/2.png + https://f-droid.org/repo/com.krawieck.lemmur/en-US/phoneScreenshots/3.png + https://f-droid.org/repo/com.krawieck.lemmur/en-US/phoneScreenshots/4.png + https://f-droid.org/repo/com.krawieck.lemmur/en-US/phoneScreenshots/5.png + https://f-droid.org/repo/com.krawieck.lemmur/en-US/phoneScreenshots/6.png + + + + com.krawieck.lemmur.desktop + + + intense + mild + intense + + \ No newline at end of file diff --git a/lib/app.dart b/lib/app.dart index 87119b7c..a1853e93 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:flutter/material.dart'; import 'package:keyboard_dismisser/keyboard_dismisser.dart'; @@ -7,6 +9,15 @@ import 'resources/theme.dart'; import 'stores/config_store.dart'; import 'util/observer_consumers.dart'; +//Fixes scroll behaviour on Linux devices +class TouchScrollBehaviour extends MaterialScrollBehavior { + @override + Set get dragDevices => { + PointerDeviceKind.touch, + PointerDeviceKind.mouse, + }; +} + class MyApp extends StatelessWidget { const MyApp(); @@ -22,6 +33,7 @@ class MyApp extends StatelessWidget { darkTheme: store.amoledDarkMode ? amoledTheme : darkTheme, locale: store.locale, theme: lightTheme, + scrollBehavior: TouchScrollBehaviour(), home: const HomePage(), ), ), diff --git a/lib/util/async_store.freezed.dart b/lib/util/async_store.freezed.dart index 8f141bac..b7285d49 100644 --- a/lib/util/async_store.freezed.dart +++ b/lib/util/async_store.freezed.dart @@ -106,22 +106,14 @@ class __$$AsyncStateInitialCopyWithImpl /// @nodoc -class _$AsyncStateInitial - with DiagnosticableTreeMixin - implements AsyncStateInitial { +class _$AsyncStateInitial implements AsyncStateInitial { const _$AsyncStateInitial(); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'AsyncState<$T>.initial()'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties.add(DiagnosticsProperty('type', 'AsyncState<$T>.initial')); - } - @override bool operator ==(dynamic other) { return identical(this, other) || @@ -249,9 +241,7 @@ class __$$AsyncStateDataCopyWithImpl /// @nodoc -class _$AsyncStateData - with DiagnosticableTreeMixin - implements AsyncStateData { +class _$AsyncStateData implements AsyncStateData { const _$AsyncStateData(this.data, [this.errorTerm]); @override @@ -260,19 +250,10 @@ class _$AsyncStateData final String? errorTerm; @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'AsyncState<$T>.data(data: $data, errorTerm: $errorTerm)'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties - ..add(DiagnosticsProperty('type', 'AsyncState<$T>.data')) - ..add(DiagnosticsProperty('data', data)) - ..add(DiagnosticsProperty('errorTerm', errorTerm)); - } - @override bool operator ==(dynamic other) { return identical(this, other) || @@ -400,22 +381,14 @@ class __$$AsyncStateLoadingCopyWithImpl /// @nodoc -class _$AsyncStateLoading - with DiagnosticableTreeMixin - implements AsyncStateLoading { +class _$AsyncStateLoading implements AsyncStateLoading { const _$AsyncStateLoading(); @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'AsyncState<$T>.loading()'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties.add(DiagnosticsProperty('type', 'AsyncState<$T>.loading')); - } - @override bool operator ==(dynamic other) { return identical(this, other) || @@ -538,27 +511,17 @@ class __$$AsyncStateErrorCopyWithImpl /// @nodoc -class _$AsyncStateError - with DiagnosticableTreeMixin - implements AsyncStateError { +class _$AsyncStateError implements AsyncStateError { const _$AsyncStateError(this.errorTerm); @override final String errorTerm; @override - String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) { + String toString() { return 'AsyncState<$T>.error(errorTerm: $errorTerm)'; } - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties - ..add(DiagnosticsProperty('type', 'AsyncState<$T>.error')) - ..add(DiagnosticsProperty('errorTerm', errorTerm)); - } - @override bool operator ==(dynamic other) { return identical(this, other) || diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index f6f23bfe..b2aaa65e 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,9 +6,13 @@ #include "generated_plugin_registrant.h" +#include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) handy_window_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin"); + handy_window_plugin_register_with_registrar(handy_window_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index f16b4c34..067673aa 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + handy_window url_launcher_linux ) diff --git a/linux/my_application.cc b/linux/my_application.cc index 1580afe3..f7466daf 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -49,17 +49,20 @@ static void my_application_activate(GApplication* application) { } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); + g_autoptr(FlDartProject) project = fl_dart_project_new(); fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); - gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + gtk_widget_show(GTK_WIDGET(window)); + gtk_widget_show(GTK_WIDGET(view)); + gtk_widget_grab_focus(GTK_WIDGET(view)); } diff --git a/pubspec.lock b/pubspec.lock index 22571acf..ea39856e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -105,7 +105,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -126,7 +126,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" code_builder: dependency: transitive description: @@ -189,7 +189,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: @@ -496,14 +496,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.1.5" matrix4_transform: dependency: "direct main" description: @@ -517,7 +517,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" path_provider: dependency: transitive description: @@ -858,7 +858,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -886,21 +886,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.12" timeago: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index d997b902..8ccb774f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,7 @@ dependencies: # native share_plus: ^4.0.4 + handy_window: ^0.1.9 url_launcher: ^6.0.3 shared_preferences: ^2.0.5 package_info_plus: ^1.0.6
+ Lemmur aims to provide a seamless experience when browsing different Lemmy instances. +
+ You can have multiple multiple instances added at the same time without having to awkwardly switch between them. +