From c2f0f45da13a6bb86c63a9e80c0313a4118bf81d Mon Sep 17 00:00:00 2001
From: j1nx
Date: Fri, 14 Oct 2022 15:16:03 +0200
Subject: [PATCH] Spotifyd as user service and session DBUS
---
.../multi-user.target.wants/spotifyd.service | 1 +
.../usr/lib/systemd/user-preset/10-ovos.preset | 1 +
.../usr/lib/systemd/user/spotifyd.service | 16 ++++++++++++++++
3 files changed, 18 insertions(+)
create mode 120000 buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/multi-user.target.wants/spotifyd.service
create mode 100644 buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service
diff --git a/buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/multi-user.target.wants/spotifyd.service b/buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/multi-user.target.wants/spotifyd.service
new file mode 120000
index 00000000..d56b0cfd
--- /dev/null
+++ b/buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/multi-user.target.wants/spotifyd.service
@@ -0,0 +1 @@
+../../../../../../usr/lib/systemd/user/spotifyd.service
\ No newline at end of file
diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user-preset/10-ovos.preset b/buildroot-external/rootfs-overlay/usr/lib/systemd/user-preset/10-ovos.preset
index ea537a31..0a9c08e9 100644
--- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user-preset/10-ovos.preset
+++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user-preset/10-ovos.preset
@@ -14,3 +14,4 @@ disable local-backend.service
enable kdeconnectd.service
enable shairport-sync.service
+enable spotifyd.service
diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service
new file mode 100644
index 00000000..a425f5e7
--- /dev/null
+++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=A Spotify connect daemon
+Documentation=https://github.com/Spotifyd/spotifyd
+Wants=sound.target
+After=sound.target
+Wants=network-online.target
+After=network-online.target
+After=pulseaudio.service
+
+[Service]
+ExecStart=/usr/bin/spotifyd --no-daemon
+Restart=always
+RestartSec=5
+
+[Install]
+WantedBy=multi-user.target