mihirlad55 / polybar-spotify-module

A collection of lightweight programs for use with a Polybar Spotify Module
GNU General Public License v3.0
140 stars 9 forks source link

IPC Updates and Minor Bugfies (Revised) #39

Closed corigne closed 7 months ago

corigne commented 11 months ago

Replaces PR ticket #38 as it was particularly unreadable due to formatting choices I initially made. I went back and revised my changes into a new fork. Having a moment to carefully pick through my original additions, I have revised them a decent amount as well, including improving the new polybar-msg routine error handling.

I was careful this time to avoid making formatting changes which might cause an excessive diff. Thank you for the feedback! Please try this fork and let me know if anything needs to be fixed/improved.

The following major changes are proposed for merge:

Bug-fixes:

*edited

corigne commented 9 months ago

There are some new side effects I'm getting from the changes that only recently cropped up, such as "%output %output %output %output" in the status bar on boot, which weren't happening before. Will look into this new bug and see if I can't sort it, and then I'll update the PR.

corigne commented 7 months ago

I've identified the cause of the output issues. They are actually unrelated to the changed proposed in this PR.

Polybar 3.7 added new functionality to the IPC module configuration which results in empty hook defaulting to labels printing %output%, even when echoing an empty string.

To switch back to the output formatting it must now be explicitly stated in the configuration. Note line 3 of the example below from my configuration:

[module/spotify]
type = custom/ipc
format = <output>
format-font = 5
format-prefix = "<ICON HERE> "
format-prefix-font = 4
format-prefix-foreground = ${colors.active}
; Default
hook-0 = echo
; Playing/paused show song name and artist
hook-1 = spotifyctl status --format '%artist% - %title%' --max-title-length 25 --max-artist-length 25 --trunc '...'

I will add read-me changes identifying the fix for this. Based on previous changes from polybar I will keep an eye out for output type format labels deprecating. 🥲

Reference: https://github.com/polybar/polybar/wiki/Module:-ipc

corigne commented 7 months ago

README changes added in https://github.com/mihirlad55/polybar-spotify-module/pull/39/commits/2545becfde9deb36caecbab3230d51d6b2d8286a

corigne commented 7 months ago

Please refer to: #40 to comment. This PR has all of the details regarding that PR.