Revert "spotify: remove socket cleaning"

This reverts commit 2e4e2d311c. Problem
is still here.
This commit is contained in:
Vincent Bernat 2022-06-30 21:18:07 +02:00
parent bb6c76f970
commit 8cd2ed3730
4 changed files with 24 additions and 0 deletions

8
bin/spotify-clean Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
# Kill all spotify streams, except the most recent one.
pactl list short clients \
| awk '($3 == "spotify") {print $1}' \
| head -n-1 \
| xargs -rn1 pacmd kill-client

View file

@ -0,0 +1,8 @@
[Unit]
Description=Clean spotify extra PulseAudio streams
After=sound.target
[Service]
ExecStart=%h/.config/i3/bin/spotify-clean
Type=oneshot
RemainAfterExit=false

View file

@ -0,0 +1,7 @@
[Unit]
Description=Timer for cleaning spotify extra PA streams
After=pulseaudio.socket
[Timer]
OnUnitActiveSec=1h
OnStartupSec=1h

View file

@ -8,6 +8,7 @@ Wants=picom.service
Wants=pipewire-pulse.socket
Wants=policykit-agent.service
Wants=redshift.service
Wants=spotify-clean.timer
Wants=ssh-agent.service
Wants=weather.timer
Wants=wireplumber.service