Clementine does not prevent system sleep while playing music
by sinisab89 from LinuxQuestions.org on (#5F4M3)
Hello! I am a Manjaro user and I have a problem with Clemetine music player. This player does not inhibit system suspend while playing music and I don't want to switch to any other music player because Clementine is really perfect except this one issue. I tried to make a service that will check if clementine is playing music before going to suspend:
Code:[Unit]
Description=Inhibit suspend if Clementine is playing music
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c "! pactl list sink-inputs | grep clementine"
[Install]
RequiredBy=sleep.targetbut it doesn't work. It gives out this error:
Code:pa_context_connect() failed: connection refusedSeems like service is refused by pulseaudio. My knowledge of this stuff is very, very limited so I need your help. Can this be solved?


Code:[Unit]
Description=Inhibit suspend if Clementine is playing music
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c "! pactl list sink-inputs | grep clementine"
[Install]
RequiredBy=sleep.targetbut it doesn't work. It gives out this error:
Code:pa_context_connect() failed: connection refusedSeems like service is refused by pulseaudio. My knowledge of this stuff is very, very limited so I need your help. Can this be solved?