diff --git a/README.md b/README.md index 4dec4d1..5b42574 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,7 @@ You can run Apostrophe with `./apostrophe.in` without installing it in the syste but you'll need to install and compile the schemas before: ```bash -# sudo cp data/de.wolfvollprecht.UberWriter.gschema.xml /usr/share/glib-2.0/schemas/de.wolfvollprecht.UberWriter.gschema.xml -# sudo glib-compile-schemas /usr/share/glib-2.0/schemas +$ ./data/gen.sh ``` ### Building a flatpak package diff --git a/apostrophe.in b/apostrophe.in index 70abee5..dc8040d 100755 --- a/apostrophe.in +++ b/apostrophe.in @@ -56,7 +56,10 @@ locale.bindtextdomain('apostrophe', localedir) gettext.textdomain('apostrophe') gettext.bindtextdomain('apostrophe', localedir) -resource = Gio.resource_load(os.path.join(pkgdatadir, 'apostrophe/apostrophe.gresource')) +if pkgdatadir != '@DATA_DIR@': + resource = Gio.resource_load(os.path.join(pkgdatadir, 'apostrophe/apostrophe.gresource')) +else: + resource = Gio.resource_load(os.path.join(os.path.dirname(__file__), 'data', 'apostrophe.gresource')) Gio.Resource._register(resource) diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..10302b8 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,2 @@ +/About.ui +/apostrophe.gresource \ No newline at end of file diff --git a/data/gen.sh b/data/gen.sh new file mode 100755 index 0000000..f25d8a1 --- /dev/null +++ b/data/gen.sh @@ -0,0 +1,5 @@ +#! /usr/bin/env bash + +cd "$(dirname "$0")" && +cp -fv "ui/About.ui.in" "About.ui" && +glib-compile-resources "apostrophe.gresource.xml" \ No newline at end of file