PrayagS / polybar-spotify

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

Play/Pause button not changing #9

Closed erikdubois closed 3 years ago

erikdubois commented 3 years ago

I was wondering if the icon of the play icon and the pause icon are supposed to switch if you click on the icon.

I see a hook referring to it.

Check out the issue on this video please.

Thanks in advance

https://youtu.be/HCRL3ENJVHc?t=1276

PrayagS commented 3 years ago

@erikdubois Thank you very much for recording it on video. Your whole experience of setting it up made me realize that I really need to add clear instructions. Please update your scripts and go through the README once again. Not updating the name of the parent bar in get_spotify_status.sh was the issue in your case. I've added that as a variable in the script so that people can easily find it and edit it.

Let me know how it goes for you. I'll appreciate the feedback. Also if you have any extra features in mind, feel free to drop them.

erikdubois commented 3 years ago

Thanks for all your efforts.

The last changes are now in our package. https://github.com/arcolinux/arcolinux-polybar

In one of the lines you search for the line that has the word polybar and the bar name.

I see in our system that the process is different. 'polybar --reload mainbar-i3' and not 'polybar mainbar-i3'.

I have set the PARENT_BAR to mainbar-i3.

Everything works just not the hook to change the icon. polybar-name

erikdubois commented 3 years ago

Kept analyzing. changing code If I launch polybar differently without the --reload same thing happens. So must be something else.

PrayagS commented 3 years ago

Thanks for bringing that up. Previously, the pattern matching was exact and hence, your parent bar wasn't being found. I changed the way it works and now, it should work regardless of the way how the bar is being launched. Please have a look again.

erikdubois commented 3 years ago

Looks good the way you find the pid but I am on a dual screen.

Might that the reason why the icon is not changing.

[erik@erik-systemproductname ~]$ pgrep -a "polybar" | grep mainbar-i3 | cut -d" " -f1
53114
53115
[erik@erik-systemproductname ~]$ 
rlipperts commented 3 years ago

Coincidentally, I stumbled across the same error when configuring my Polybar.

The current script expects to find only one bar with the name specified. Multimonitor setups create the same bar multiple (which might be not the best way to implement this, since it is normal to expect the bar name to be an unique identifier) times resulting in the script messaging process with PID 53114\n53115.

The pull request makes it send a message for each bar that is returned.

PrayagS commented 3 years ago

@erikdubois Please have a look again. The PR from @rlipperts should fix the issue. I never came across this as I place different bars on different monitors. Thanks again for your feedback and pointing out this issue.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.