Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install Dependencies
run: |
apt update
apt install -y libgranite-dev meson valac
apt install -y libgranite-dev systemd-dev meson valac
- name: Build
env:
DESTDIR: out
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ You'll need the following dependencies:

libgranite-dev >= 6.0.0
libgtk3-dev
systemd-dev
meson
valac

Expand Down
12 changes: 0 additions & 12 deletions data/bluetooth-daemon.desktop

This file was deleted.

12 changes: 12 additions & 0 deletions data/bluetooth.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Bluetooth Daemon
After=gnome-session-initialized.target

[Install]
WantedBy=gnome-session-initialized.target

[Service]
Type=exec
ExecStart=@bindir@/io.elementary.bluetooth -s
Restart=on-failure
Slice=session.slice
23 changes: 18 additions & 5 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@ foreach i : icon_sizes
)
endforeach

install_data(
'bluetooth-daemon.desktop',
rename: meson.project_name() + '.desktop',
install_dir: get_option('sysconfdir') / 'xdg' / 'autostart'
)
systemd_user_unit_dir = get_option('systemduserunitdir')
if systemd_user_unit_dir != 'no'
systemd_dep = dependency ('systemd')

if systemd_user_unit_dir == ''
systemd_user_unit_dir = systemd_dep.get_variable('systemduserunitdir', pkgconfig_define: ['prefix', prefix])
endif

service_config = configuration_data()
service_config.set('bindir', bindir)

configure_file(
input: 'bluetooth.service.in',
output: meson.project_name() + '.service',
configuration: service_config,
install_dir: systemd_user_unit_dir
)
endif

i18n.merge_file(
input: 'bluetooth.desktop',
Expand Down
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), lan
gnome = import('gnome')
i18n = import('i18n')

prefix = get_option('prefix')
bindir = prefix / get_option('bindir')

granite_dep = dependency ('granite')
gtk_dep = dependency ('gtk+-3.0')
posix_dep = meson.get_compiler('vala').find_library('posix')
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('systemduserunitdir', type: 'string', value: '', description: 'custom directory for systemd user units, or \'no\' to disable')