vivien / i3blocks-contrib

Official repository for community contributed blocklets
https://github.com/vivien/i3blocks
Other
1.29k stars 485 forks source link

Mediaplayer blocket no longer working after spotify update #220

Open jackwoodside opened 5 years ago

jackwoodside commented 5 years ago

Expected behavior

Media player blocklet shows icon, artist and song name from spotify

Actual behavior

After the most recent spotify update, it now only displays the icon and artist name. When run from the command line it seems to be detecting the song name, just not displaying it in the bar?

i3blocks config relevant to blocklet(s)

[mediaplayer] instance=spotify interval=5 signal=10 label=

Output of blocklet(s) when run from command line

[{"full_text":""},{"":"","full_text":" Bastille","short_text":" - The Silence","name":"mediaplayer","instance":"spotify","separator_block_width":10,"markup":"none"},{"":"","full_text":"03 Mar 14:19 ","name":"time","separator_block_width":10,"markup":"none"}]

kb100 commented 5 years ago

Hi, it looks like you posted the output of i3blocks when run from the command line. Would you please additionally post the output of the block itself run from the command line, i.e., by running

BLOCK_INSTANCE=spotify interval=5 signal=10 label= $SCRIPT_DIR/mediaplayer
jackwoodside commented 5 years ago

Which directory would the scripts be in if I installed the package via the Arch Linux package manager? I checked a few locations I thought they might be but couldn't find them.

jackwoodside commented 5 years ago

Managed to find it,

BLOCK_INSTANCE=spotify interval=5 signal=10 label= $SCRIPT_DIR/mediaplayer 

returns

Bastille
 - The Silence

So it seems to be working here as well, just not in the bar itself?

Maradonna90 commented 5 years ago

its because the strings have a \nat the end. It can be fixed by using chomp(@metadata); before the join.

This is just a quickfix for me, bc im neither a perl expert, nor did i took the time to go through the whole script.

jackwoodside commented 5 years ago

its because the strings have a \nat the end. It can be fixed by using chomp(@metadata); before the join.

This is just a quickfix for me, bc im neither a perl expert, nor did i took the time to go through the whole script.

Thanks, I added that line and now it displays properly in the bar.