From 3b0af76dad80d3bba5a81bfe0b3af9d4ce003828 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 26 Jun 2022 13:51:22 +0200 Subject: [PATCH] Revert "music: replace Spotify by Deezer" This reverts commit 4af98c2589787ed17bb7eea270e6ec2c9107924a. I feel like they should provide a native client for Linux instead of relying upon the community. MellowPlayer is unmaintained and does not have an offline mode. Deezer seems the only streaming service with a Linux client. --- bin/i3-companion | 2 -- bin/rofi-mediaplayer | 2 +- bin/spotify-clean | 8 ++++++++ config | 2 +- dotfiles/systemd/spotify-clean.service | 8 ++++++++ dotfiles/systemd/spotify-clean.timer | 7 +++++++ dotfiles/systemd/xsession.target | 1 + 7 files changed, 26 insertions(+), 4 deletions(-) create mode 100755 bin/spotify-clean create mode 100644 dotfiles/systemd/spotify-clean.service create mode 100644 dotfiles/systemd/spotify-clean.timer diff --git a/bin/i3-companion b/bin/i3-companion index 4c50add..6f54249 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -45,7 +45,6 @@ application_icons = { "chromium": icon(3, ""), "d-feet": icon(2, ""), "darktable": icon(2, ""), - "deezer": icon(3, ""), "discord": icon(3, ""), "draw.io": icon(2, ""), "easyeffects": icon(2, ""), @@ -62,7 +61,6 @@ application_icons = { "jitsi meet": icon(2, ""), "libreoffice": icon(2, "📄"), "mednafen": icon(2, ""), - "mellowplayer3": icon(3, ""), "mpv": icon(2, ""), "nestopia": icon(2, ""), "org.gnome.maps": icon(2, ""), diff --git a/bin/rofi-mediaplayer b/bin/rofi-mediaplayer index 0e95b09..ea94f76 100755 --- a/bin/rofi-mediaplayer +++ b/bin/rofi-mediaplayer @@ -41,7 +41,7 @@ media-playback-pause Pause media-playback-stop Stop go-next Next track multimedia-volume-control Open mixer panel -com.gitlab.ColinDuquesnoy.MellowPlayer Open ${Mediaplayer} +com.spotify.Client Open ${Mediaplayer} EOF # Player status diff --git a/bin/spotify-clean b/bin/spotify-clean new file mode 100755 index 0000000..924adb3 --- /dev/null +++ b/bin/spotify-clean @@ -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 diff --git a/config b/config index f4c5d33..176e6e5 100644 --- a/config +++ b/config @@ -6,7 +6,7 @@ set $down k set $left j set $right semicolon set $term vbeterm -set $mediaplayer MellowPlayer3 +set $mediaplayer spotify set $borderpx 3 font pango:Iosevka Aile 9 diff --git a/dotfiles/systemd/spotify-clean.service b/dotfiles/systemd/spotify-clean.service new file mode 100644 index 0000000..190068c --- /dev/null +++ b/dotfiles/systemd/spotify-clean.service @@ -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 diff --git a/dotfiles/systemd/spotify-clean.timer b/dotfiles/systemd/spotify-clean.timer new file mode 100644 index 0000000..2bd5c80 --- /dev/null +++ b/dotfiles/systemd/spotify-clean.timer @@ -0,0 +1,7 @@ +[Unit] +Description=Timer for cleaning spotify extra PA streams +After=pulseaudio.socket + +[Timer] +OnUnitActiveSec=1h +OnStartupSec=1h diff --git a/dotfiles/systemd/xsession.target b/dotfiles/systemd/xsession.target index b8c2278..d94a183 100644 --- a/dotfiles/systemd/xsession.target +++ b/dotfiles/systemd/xsession.target @@ -8,6 +8,7 @@ Wants=picom.service Wants=policykit-agent.service Wants=pipewire-pulse.socket Wants=redshift.service +Wants=spotify-clean.timer Wants=ssh-agent.service Wants=weather.timer Wants=wireplumber.service