From b78183fa6e0cd0a44bb07b8df7801ae42722d943 Mon Sep 17 00:00:00 2001 From: Alexandre CATTEAU Date: Mon, 14 Mar 2022 22:06:45 +0100 Subject: [PATCH] Initial commit --- README.md | 10 ++++++++++ install.sh | 12 ++++++++++++ pulseaudio-dlna.service | 21 +++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 README.md create mode 100755 install.sh create mode 100644 pulseaudio-dlna.service diff --git a/README.md b/README.md new file mode 100644 index 0000000..d00786e --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# pulseaudio-dlna Systemd service unit + +Just a simple user service unit for [pulseaudio-dlna](https://github.com/masmu/pulseaudio-dlna). + +### Files +* `pulseaudio-dlna.service` provides a service for pulseaudio-dlna. +#### Installation +* `install.sh` copies above Systemd unit to user's adequate directory and enables the service. + +### TODO diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..8625948 --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +echo "Copying Systemd units to user's directory..." +cp $(dirname "$0")/pulseaudio-dlna.service $HOME/.config/systemd/user/ + +echo "Reloading Systemd's user runtime..." +systemctl --user daemon-reload +echo "Enabling service..." +systemctl --user enable pulseaudio-dlna.service + +echo "Finished install. Exiting..." +exit 0 diff --git a/pulseaudio-dlna.service b/pulseaudio-dlna.service new file mode 100644 index 0000000..954b667 --- /dev/null +++ b/pulseaudio-dlna.service @@ -0,0 +1,21 @@ +# This file is to be placed in /home/alex/.sync +# A symlink should then be created at ~/.config/systemd/user/pulseaudio-dlna.service +# This is just a service file for pulseaudio-dlna, which is run in user session +# It can be enabled (in user mode) in order to see DLNA renderers in audio devices + +[Unit] +Description=DLNA renderers support for PulseAudio +After=pulseaudio.service pulseaudio.socket +#Requisite=pulseaudio.service +ConditionUser=!root + +[Service] +Type=simple +# I'd rather have used herebefore Requisite statement, but pulseaudio is ativated by its socket, and Requisite doesn't +# wait long enough... +ExecStartPre=/usr/bin/sleep 10 +ExecStart=/usr/bin/pulseaudio-dlna + +[Install] +WantedBy=default.target +