mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-15 12:44:21 +02:00
15 lines
428 B
Bash
Executable file
15 lines
428 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# Kill all spotify streams, except the most recent one. We need to use
|
|
# the serial to know which one this is as ID are not monotonous.
|
|
|
|
pw-cli dump short client \
|
|
| grep -F 'ap="spotify"' \
|
|
| cut -d: -f1 \
|
|
| while read id; do
|
|
echo $(pw-cli dump $id | sed -nE 's/^\s*object.serial = "([0-9]*)"/\1/p') $id
|
|
done \
|
|
| sort -n \
|
|
| cut -d' ' -f2 \
|
|
| head -n-1 \
|
|
| xargs -trn1 pw-cli destroy
|