diff --git a/bin/com.github.rafostar.ClapperRemote.in b/bin/com.github.rafostar.ClapperRemote.in index e567a7b9..326794ff 100644 --- a/bin/com.github.rafostar.ClapperRemote.in +++ b/bin/com.github.rafostar.ClapperRemote.in @@ -1,5 +1,10 @@ #!@GJS@ +/* pkg init enforces the imports path to the folder + * named after the pkg name, but I would prefer to have + * the bundled subprocess stored in the same directory */ +imports.searchPath.unshift('@datadir@/@PROJECT_NAME@'); + const Package = imports.package; Package.init({ diff --git a/bin/meson.build b/bin/meson.build index 6a3aec8e..d077c7d5 100644 --- a/bin/meson.build +++ b/bin/meson.build @@ -1,14 +1,15 @@ -bin_conf = configuration_data() -bin_conf.set('GJS', find_program('gjs').path()) -bin_conf.set('PACKAGE_VERSION', meson.project_version()) -bin_conf.set('PACKAGE_NAME', meson.project_name()) -bin_conf.set('prefix', get_option('prefix')) -bin_conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir'))) -bin_conf.set('datadir', join_paths(get_option('prefix'), get_option('datadir'))) - clapper_apps = [ '', 'Remote' ] foreach id_postfix : clapper_apps + bin_conf = configuration_data() + bin_conf.set('GJS', find_program('gjs').path()) + bin_conf.set('PROJECT_NAME', meson.project_name()) + bin_conf.set('PACKAGE_NAME', meson.project_name() + id_postfix) + bin_conf.set('PACKAGE_VERSION', meson.project_version()) + bin_conf.set('prefix', get_option('prefix')) + bin_conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir'))) + bin_conf.set('datadir', join_paths(get_option('prefix'), get_option('datadir'))) + configure_file( input: 'com.github.rafostar.Clapper' + id_postfix + '.in', output: 'com.github.rafostar.Clapper' + id_postfix, diff --git a/clapper_src/appBase.js b/clapper_src/appBase.js index b2224612..2d93396a 100644 --- a/clapper_src/appBase.js +++ b/clapper_src/appBase.js @@ -14,13 +14,12 @@ class ClapperAppBase extends Gtk.Application opts = opts || {}; let defaults = { - idPostfix: '', playlist: [], }; Object.assign(this, defaults, opts); super._init({ - application_id: Misc.appId + this.idPostfix + application_id: Misc.appId, }); this.doneFirstActivate = false; diff --git a/clapper_src/mainRemote.js b/clapper_src/mainRemote.js index 6321f769..53bafed1 100644 --- a/clapper_src/mainRemote.js +++ b/clapper_src/mainRemote.js @@ -4,14 +4,13 @@ imports.gi.versions.Gtk = '4.0'; const { AppRemote } = imports.clapper_src.appRemote; const Misc = imports.clapper_src.misc; -const opts = { - idPostfix: 'Remote', -}; +const ID_POSTFIX = 'Remote'; -Misc.clapperPath = pkg.datadir + '/' + - pkg.name.substring(0, pkg.name.lastIndexOf(opts.idPostfix)); +Misc.clapperPath = `${pkg.datadir}/${Misc.appId}`; +Misc.appName += ID_POSTFIX; +Misc.appId += '.' + ID_POSTFIX; function main() { - new AppRemote(opts).run(); + new AppRemote().run(); }