Robert Smith <address@hidden> skribis:
Set the XDG_RUNTIME_PATH environment variable in the mpd
service so
that it can detect pulseaudio when run under a user account.
---
gnu/services/audio.scm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 471c5fd95f..424ccc7c8f 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -140,6 +140,12 @@ audio_output {
"--no-daemon"
#$(mpd-config->file config))
#:pid-file #$(mpd-file-name config "pid")
+ #:environment-variables
+ '(#$(string-append
+ "XDG_RUNTIME_DIR=/run/user/"
+ (number->string
+ (passwd:uid
+ (getpwnam (mpd-configuration-user
config))))))
#:log-file #$(mpd-file-name config "log")))
I suppose this is meant for the libpulse client library, right?
(I’m
surprised it’s not the default, but apparently that’s the way it
is.)
Note that this also has an effect on mpd itself from what I can
see in
the source: mpd will listen to $XDG_RUNTIME_DIR/mpd/socket
instead of
(in addition to?) listening on TCP.
I don’t use mpd myself; could you ensure that the socket change
is also
fine and doesn’t cause any troubles for mpd clients?