PrayagS / polybar-spotify

:musical_note: Spotify status and controls module for Polybar with text scrolling
MIT License
581 stars 38 forks source link

Song name is disappearing sometimes #8

Closed PoSayDone closed 3 years ago

PoSayDone commented 3 years ago

The music is playing and module is working properly, but sometimes song name is disappears and "No music is playing" caption appears. After ~5 sec all is back to normal. (I am using scripts from your dotfiles) I am using spotify-tui and spotifyd as a daemon screenshot_20201105_224808 screenshot_20201105_224812

PoSayDone commented 3 years ago

So, I think is the problem of spotifyd or spotify-tui.

PrayagS commented 3 years ago

Thanks for the heads up. The player defined in the scripts is playerctld which tries to find the currently active music player. Try changing it to spotify and see if the issue comes up. If not, it might just be a problem of spotifyd or spotify-tui as you said.

PoSayDone commented 3 years ago

If someone would have the same issue use this instructions.

  1. Compile spotifyd from source (master branch is ok), as the latest official build is quite old and doesn't have @SirWindfield's hotfix. Alternatively, you can checkout v0.2.24 and patch it yourself

  2. When you build/install, make sure that you set at least the --features dbus_mpris flag, along with anything else you need

  3. If you have a config file, make sure it's in the new TOML format to avoid problems, as the binary doesn't have that yet either

  4. Go to https://developer.spotify.com/dashboard/login, create an app (call it whatever), and copy the client ID

  5. When you run spotifyd, set the SPOTIFYD_CLIENT_ID environment variable to that client ID, e.g. with the default one SPOTIFYD_CLIENT_ID=2c1ea588dfbc4a989e2426f8385297c3 spotifyd --no-daemon

  6. If you use systemd, you can add the environment variable to the [Service] section of your spotifyd.service, like below spotifyd.service file with token:

    
    [Unit]
    Description=A spotify playing daemon
    Documentation=https://github.com/Spotifyd/spotifyd
    Wants=sound.target
    After=sound.target
    Wants=network-online.target
    After=network-online.target

[Service] ExecStart=/usr/bin/spotifyd --no-daemon Restart=always RestartSec=12 Environment=SPOTIFYD_CLIENT_ID= your id

[Install] WantedBy=default.target


Big thanks to @yousefamar