diff --git a/README.md b/README.md index df4e232..b5b7127 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,38 @@ echo "power on" | sudo bluetoothctl ``` Icons by svgrepo.com +## Building and installing Flatpak app + +### Building and installing on target architecture + +``` +flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +flatpak install --user flathub org.gnome.Sdk//3.38 org.gnome.Platform//3.38 + +flatpak-builder --repo=repo --force-clean build-dir/ org.gnome.siglo.json +flatpak build-bundle ./repo/ siglo.flatpak org.gnome.siglo +flatpak install --user ./siglo.flatpak +``` + +### Cross-compiling for PinePhone + +Example cross-compiling for PinePhone on an `x86_64` Fedora machine: + +``` +sudo dnf install qemu-system-arm qemu-user-static +flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +flatpak install --user flathub org.gnome.Sdk/aarch64/3.38 org.gnome.Platform/aarch64/3.38 + +flatpak-builder --arch=aarch64 --repo=repo --force-clean build-dir org.gnome.siglo.json +flatpak build-bundle --arch=aarch64 ./repo/ siglo.flatpak org.gnome.siglo +``` + +Transfer the `siglo.flatpak` file on the PinePhone and install it with the following command: + +``` +sudo flatpak install ./siglo.flatpak +``` + ## If this project helped you, you can buy me a cup of coffee :)

diff --git a/data/org.gnome.siglo.appdata.xml.in b/data/org.gnome.siglo.appdata.xml.in index c8a7116..b49ce47 100644 --- a/data/org.gnome.siglo.appdata.xml.in +++ b/data/org.gnome.siglo.appdata.xml.in @@ -4,5 +4,8 @@ CC0-1.0 LicenseRef-proprietary +

+ GTK app to sync InfiniTime watch with PinePhone +

diff --git a/org.gnome.siglo.json b/org.gnome.siglo.json index 4d7388e..ac12890 100644 --- a/org.gnome.siglo.json +++ b/org.gnome.siglo.json @@ -5,9 +5,11 @@ "sdk" : "org.gnome.Sdk", "command" : "siglo", "finish-args" : [ + "--allow=bluetooth", "--share=network", "--share=ipc", "--socket=fallback-x11", + "--socket=system-bus", "--socket=wayland" ], "cleanup" : [ @@ -46,6 +48,30 @@ "pip3 install --prefix=/app --no-cache-dir dbus-python" ] }, + { + "name": "python3-requests", + "buildsystem": "simple", + "build-options": { + "build-args": [ + "--share=network" + ] + }, + "build-commands": [ + "pip3 install --prefix=/app --no-cache-dir requests" + ] + }, + { + "name": "python3-pyxdg", + "buildsystem": "simple", + "build-options": { + "build-args": [ + "--share=network" + ] + }, + "build-commands": [ + "pip3 install --prefix=/app --no-cache-dir pyxdg" + ] + }, { "name" : "siglo", "builddir" : true, @@ -53,7 +79,8 @@ "sources" : [ { "type" : "git", - "url" : "file:///home/malex/Projects/siglo" + "url" : "https://github.com/alexr4535/siglo", + "tag" : "v0.6.2" } ] } diff --git a/src/config.py b/src/config.py index 4666499..3544065 100644 --- a/src/config.py +++ b/src/config.py @@ -1,12 +1,12 @@ import configparser +import xdg.BaseDirectory from pathlib import Path class config: # Class constants default_config = {"mode": "singleton", "deploy_type": "quick"} - home_dir = str(Path.home()) - config_dir = home_dir + "/.config/siglo" + config_dir = xdg.BaseDirectory.xdg_config_home config_file = config_dir + "/siglo.ini" def load_defaults(self):