Skip to content

Add D-Bus service file #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/dev.geopjr.Tuba.desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ MimeType=x-scheme-handler/tuba;x-scheme-handler/web+ap;
# Translators: Do NOT translate or transliterate this text (these are enum types)!
X-Purism-FormFactor=Workstation;Mobile;
StartupNotify=true
DBusActivatable=true
3 changes: 3 additions & 0 deletions data/dev.geopjr.Tuba.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=dev.geopjr.Tuba
Exec=@BINDIR@/dev.geopjr.Tuba --gapplication-service
12 changes: 12 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ if desktop_utils.found()
test('Validate desktop file', desktop_utils, args: [desktop_file])
endif

configure_file(
input: meson.project_name() + '.service.in',
output: meson.project_name() + '.service',
configuration: config,
install: true,
install_dir: join_paths(
get_option('datadir'),
'dbus-1',
'services',
),
)

if host_machine.system() != 'windows' and host_machine.system() != 'darwin'
appstream_file = i18n.merge_file(
input: meson.project_name() + '.metainfo.xml.in',
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ distro = get_option('distro')
config = configuration_data()
config.set('EXEC_NAME', meson.project_name())
config.set('GETTEXT_PACKAGE', meson.project_name())
config.set('BINDIR', join_paths(get_option('prefix'), get_option('bindir')))
config.set('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
config.set('DOMAIN', meson.project_name ())
config.set('G_LOG_DOMAIN', 'Tuba')
Expand Down
3 changes: 2 additions & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ namespace Tuba {
// maintenance_secs = 30
// };
accounts = new SecretAccountStore ();
accounts.init ();

// css_provider.load_from_resource (@"$(Build.RESOURCES)app.css");
// StyleContext.add_provider_for_display (Gdk.Display.get_default (), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
Expand Down Expand Up @@ -374,6 +373,8 @@ namespace Tuba {

private bool activated = false;
protected override void activate () {
if (!activated) accounts.init ();

activated = true;
present_window ();

Expand Down
Loading