[tracker-miners/sam/only-music-and-videos: 1/3] Disable miner autostart by default




commit 39eeab3f4fa94d333f0a7bb05c3d81472c2c00ff
Author: Sam Thursfield <sam afuera me uk>
Date:   Tue Sep 1 15:54:26 2020 +0200

    Disable miner autostart by default
    
    For GNOME 3.38, Tracker 3 is only used by two apps: Totem and Music.
    Thus, disable the miners by default so they only start when needed.

 meson_options.txt          |  2 ++
 src/miners/fs/meson.build  | 10 +++++++---
 src/miners/rss/meson.build | 10 +++++++---
 3 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index 3420973ab..4ef4dd9ff 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -83,6 +83,8 @@ option('generic_media_extractor', type: 'combo', choices: ['auto', 'gstreamer',
 option('gstreamer_backend', type: 'combo', choices: ['discoverer', 'gupnp'], value: 'discoverer',
        description: 'When GStreamer is used, this enables one of the (discoverer, gupnp) GStreamer backends')
 
+option('autostart', type: 'boolean', value: false,
+       description: 'Install .desktop files into $sysconfdir/xdg/autostart so miners start along with 
desktop session')
 option('dbus_services_dir', type: 'string',
        description: 'Directory to install D-Bus .service files (value from dbus-1.pc is used by default)')
 option('systemd_user_services', type: 'boolean', value: true,
diff --git a/src/miners/fs/meson.build b/src/miners/fs/meson.build
index e700dee6f..d6ec6fe03 100644
--- a/src/miners/fs/meson.build
+++ b/src/miners/fs/meson.build
@@ -51,9 +51,13 @@ dbus_service_file = configure_file(
 desktop_file = configure_file(
     input: 'tracker-miner-fs.desktop.in',
     output: 'tracker-miner-fs-@0@.desktop'.format(tracker_api_major),
-    configuration: conf,
-    install: true,
-    install_dir: xdg_autostart_dir)
+    configuration: conf)
+
+if get_option('autostart')
+  install_data(desktop_file,
+      install: true,
+      install_dir: join_paths(get_option('sysconfdir'), 'xdg/autostart'))
+endif
 
 if get_option('systemd_user_services')
   # This file allows starting the service as a systemd user service.
diff --git a/src/miners/rss/meson.build b/src/miners/rss/meson.build
index 84eaa6bc0..5f83c6bcb 100644
--- a/src/miners/rss/meson.build
+++ b/src/miners/rss/meson.build
@@ -27,9 +27,13 @@ dbus_service_file = configure_file(
 desktop_file = configure_file(
     input: 'tracker-miner-rss.desktop.in',
     output: 'tracker-miner-rss-@0@.desktop'.format(tracker_api_major),
-    configuration: conf,
-    install: true,
-    install_dir: xdg_autostart_dir)
+    configuration: conf)
+
+if get_option('autostart')
+  install_data(desktop_file,
+      install: true,
+      install_dir: join_paths(get_option('sysconfdir'), 'xdg/autostart'))
+endif
 
 if get_option('systemd_user_services')
   # This file allows starting the service as a systemd user service.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]